aboutsummaryrefslogtreecommitdiffstats
path: root/tfshark.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-09-10 01:27:28 +0200
committerPeter Wu <peter@lekensteyn.nl>2016-09-10 13:00:22 +0000
commite5fef1d73e687807ae1df40979ffc5a65dda03cc (patch)
tree5d220881bf0dde6ec2a9a192b5c99d08136e79b6 /tfshark.c
parent4b05159dfec9e3e4495982e70803d7d49c13f54b (diff)
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 <peter@lekensteyn.nl>
Diffstat (limited to 'tfshark.c')
-rw-r--r--tfshark.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tfshark.c b/tfshark.c
index 49cb26a..bc7323e 100644
--- a/tfshark.c
+++ b/tfshark.c
@@ -420,6 +420,8 @@ main(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);
/*
* In order to have the -X opts assigned before the wslua machine starts
@@ -854,7 +856,8 @@ main(int argc, char *argv[])
}
break;
case 'v': /* Show version and exit */
- {
+ comp_info_str = get_compiled_version_info(NULL, epan_get_compiled_version_info);
+ runtime_info_str = get_runtime_version_info(get_tfshark_runtime_version_info);
show_version("TFShark (Wireshark)", comp_info_str, runtime_info_str);
g_string_free(comp_info_str, TRUE);
g_string_free(runtime_info_str, TRUE);
@@ -868,7 +871,6 @@ main(int argc, char *argv[])
#endif
epan_cleanup();
return 0;
- }
case 'O': /* Only output these protocols */
/* already processed; just ignore it now */
break;