diff options
author | Petr Machata <pmachata@redhat.com> | 2013-11-11 02:27:08 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2013-11-11 02:27:08 +0100 |
commit | 0ba3c5eee259b77e3883e40c4d0cd2fab5b03ff3 (patch) | |
tree | 42e2a964fdd66ed49324df8e82970bd2d183aa5a | |
parent | c00837c2928da53a3515b107399b742ea157e78a (diff) | |
download | ltrace-0ba3c5eee259b77e3883e40c4d0cd2fab5b03ff3.tar.gz |
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); |