diff options
author | Peter Wu <peter@lekensteyn.nl> | 2016-03-28 17:50:28 +0200 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2016-03-29 06:01:31 +0000 |
commit | 0aa0fb25e048c1d9abca03a8a1681b99ddcc7410 (patch) | |
tree | 9ff3e8bada67da033c6d1e6c839d845af696474b /wsutil | |
parent | 24768a7147b27daba28e2e88c333f0826724fe80 (diff) |
Another round of extcap memleak fixes
Fix a bunch of memory leaks, mainly because extcap_base_cleanup is not
called on most execution paths and because memory allocated for options
were not freed.
Additionally, randpkt will now fail if no option is given (it previously
returned 0 if --capture was missing). Logic using "goto" is introduced
with the idea that a program should fail (ret = EXIT_FAILURE) unless
proven otherwise.
Now none of the extcap programs are leaking:
for what in ssh cisco; do
for arg in '' --help --extcap-interfaces --extcap-interface=$what; do
extcap/${what}dump $arg; done; done
./tshark -D
Change-Id: I6df1027ed0c32bd53fe87e6c54d355bc8ddd01f5
Reviewed-on: https://code.wireshark.org/review/14671
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'wsutil')
-rw-r--r-- | wsutil/interface.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/wsutil/interface.c b/wsutil/interface.c index 93ed505fe6..af48b29d87 100644 --- a/wsutil/interface.c +++ b/wsutil/interface.c @@ -87,6 +87,7 @@ GSList *local_interfaces_to_list(void) interfaces = g_slist_prepend(interfaces, g_strdup(ip)); } } + freeifaddrs(ifap); end: #endif /* HAVE_GETIFADDRS */ return interfaces; |