From: Petr Machata Date: Mon, 11 Nov 2013 01:27:08 +0000 (+0100) Subject: In ltrace_init, don't call ltelf_destroy if ltelf_init fails X-Git-Tag: accepted/tizen/common/20140822.152031~130 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0d40630b921a3b54c35ff38be6f8e3fb13061cb;p=platform%2Fupstream%2Fltrace.git In ltrace_init, don't call ltelf_destroy if ltelf_init fails --- diff --git a/libltrace.c b/libltrace.c index a8dd61e..2d910a1 100644 --- a/libltrace.c +++ b/libltrace.c @@ -116,9 +116,13 @@ ltrace_init(int argc, char **argv) if (command) { /* Check that the binary ABI is supported before * calling execute_program. */ - struct ltelf lte; - ltelf_init(<e, command); - ltelf_destroy(<e); + { + struct ltelf lte; + if (ltelf_init(<e, command) == 0) + ltelf_destroy(<e); + else + exit(EXIT_FAILURE); + } pid_t pid = execute_program(command, argv); struct process *proc = open_program(command, pid);