From e5fef1d73e687807ae1df40979ffc5a65dda03cc Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sat, 10 Sep 2016 01:27:28 +0200 Subject: Fix version-string releated memleak for some CLI tools These programs resulted on a memleak report on exit. Change-Id: I630618f50d723b7af4cb00ba29671d4e7c6fcdc2 Reviewed-on: https://code.wireshark.org/review/17623 Reviewed-by: Peter Wu --- text2pcap.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'text2pcap.c') diff --git a/text2pcap.c b/text2pcap.c index d364984d62..855df5e54c 100644 --- a/text2pcap.c +++ b/text2pcap.c @@ -1467,6 +1467,8 @@ parse_options (int argc, char *argv[]) "\n" "%s", get_ws_vcs_version_info(), comp_info_str->str, runtime_info_str->str); + g_string_free(comp_info_str, TRUE); + g_string_free(runtime_info_str, TRUE); /* Scan CLI parameters */ while ((c = getopt_long(argc, argv, "aDdhqe:i:l:m:no:u:s:S:t:T:v4:6:", long_options, NULL)) != -1) { @@ -1675,6 +1677,8 @@ parse_options (int argc, char *argv[]) break; case 'v': + comp_info_str = get_compiled_version_info(NULL, NULL); + runtime_info_str = get_runtime_version_info(NULL); show_version("Text2pcap (Wireshark)", comp_info_str, runtime_info_str); g_string_free(comp_info_str, TRUE); g_string_free(runtime_info_str, TRUE); -- cgit v1.2.1