aboutsummaryrefslogtreecommitdiff
path: root/libltrace.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-10-27 00:30:13 +0200
committerPetr Machata <pmachata@redhat.com>2012-10-27 00:30:13 +0200
commit8a98e6f756c7e6a4171e7dee563f0efbb28b9f33 (patch)
tree4b28d85e5efe25fa1a908ebc3231f14a991d8367 /libltrace.c
parent47d70f6efd145113ad555dd2ba542d1050bbb784 (diff)
downloadltrace-8a98e6f756c7e6a4171e7dee563f0efbb28b9f33.tar.gz
Fix memory handling of -F arguments
This plugs a leak.
Diffstat (limited to 'libltrace.c')
-rw-r--r--libltrace.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libltrace.c b/libltrace.c
index 214b332..7c74c50 100644
--- a/libltrace.c
+++ b/libltrace.c
@@ -127,7 +127,12 @@ ltrace_init(int argc, char **argv) {
} else {
read_config_file(opt_F->filename);
}
- opt_F = opt_F->next;
+
+ struct opt_F_t *next = opt_F->next;
+ if (opt_F->own_filename)
+ free(opt_F->filename);
+ free(opt_F);
+ opt_F = next;
}
if (command) {
/* Check that the binary ABI is supported before