From 2009dcc98dc46712c8b64ae30408c4d53c64980b Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sat, 7 Jan 2017 00:14:23 +0100 Subject: extcap: fix memleak via data_file_url Commit v2.1.0rc0-2181-ga4e2263ac4 introduced a helppage parameter, but all callers were NULL. In a later change, callers would use the data_file_url() function, but this needs to be freed, so do that. Fixes: v2.3.0rc0-1825-ge5596b74bd ("extcap: set help page for all extcaps.") Change-Id: I967c0f8c6b50d9e78ac227575de24a81f97d376a Reviewed-on: https://code.wireshark.org/review/19570 Petri-Dish: Dario Lombardo Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo --- extcap/androiddump.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'extcap/androiddump.c') diff --git a/extcap/androiddump.c b/extcap/androiddump.c index a7649c3634..ea7ec94242 100644 --- a/extcap/androiddump.c +++ b/extcap/androiddump.c @@ -2584,6 +2584,7 @@ int main(int argc, char **argv) { const char *default_bt_local_ip = "127.0.0.1"; unsigned short default_bt_local_tcp_port = 4330; extcap_parameters * extcap_conf = NULL; + char *help_url; char *help_header = NULL; #ifdef _WIN32 @@ -2594,8 +2595,10 @@ int main(int argc, char **argv) { extcap_conf = g_new0(extcap_parameters, 1); + help_url = data_file_url("androiddump.html"); extcap_base_set_util_info(extcap_conf, argv[0], ANDROIDDUMP_VERSION_MAJOR, ANDROIDDUMP_VERSION_MINOR, - ANDROIDDUMP_VERSION_RELEASE, data_file_url("androiddump.html")); + ANDROIDDUMP_VERSION_RELEASE, help_url); + g_free(help_url); help_header = g_strdup_printf( " %s --extcap-interfaces [--adb-server-ip=] [--adb-server-tcp-port=]\n" -- cgit v1.2.1