diff options
author | Petr Machata <pmachata@redhat.com> | 2013-11-11 02:27:08 +0100 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-08-22 20:38:23 +0900 |
commit | d0d40630b921a3b54c35ff38be6f8e3fb13061cb (patch) | |
tree | 42e2a964fdd66ed49324df8e82970bd2d183aa5a | |
parent | e6c25f6799825812e2b87990333c649ba796f600 (diff) | |
download | ltrace-d0d40630b921a3b54c35ff38be6f8e3fb13061cb.tar.gz ltrace-d0d40630b921a3b54c35ff38be6f8e3fb13061cb.tar.bz2 ltrace-d0d40630b921a3b54c35ff38be6f8e3fb13061cb.zip |
In ltrace_init, don't call ltelf_destroy if ltelf_init fails
-rw-r--r-- | libltrace.c | 10 |
1 files changed, 7 insertions, 3 deletions
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); |