diff options
author | Petr Machata <pmachata@redhat.com> | 2012-10-27 00:30:13 +0200 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2012-10-27 00:30:13 +0200 |
commit | 8a98e6f756c7e6a4171e7dee563f0efbb28b9f33 (patch) | |
tree | 4b28d85e5efe25fa1a908ebc3231f14a991d8367 /libltrace.c | |
parent | 47d70f6efd145113ad555dd2ba542d1050bbb784 (diff) | |
download | ltrace-8a98e6f756c7e6a4171e7dee563f0efbb28b9f33.tar.gz |
Fix memory handling of -F arguments
This plugs a leak.
Diffstat (limited to 'libltrace.c')
-rw-r--r-- | libltrace.c | 7 |
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 |