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 @@
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);