aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-06-23 21:46:48 +0200
committerAnders Broman <a.broman58@gmail.com>2015-06-23 20:18:37 +0000
commit2b68a6f450ae9094241707caaf87f2d16e258cf5 (patch)
treebb22f8872577cb877b4253647de1ec97db123907 /tshark.c
parentd85a221cd31b72ea757c5ea7d54b58eb7db28180 (diff)
tshark: fix memleak from version lookup
Immediately release memory after using it, fixes a direct memleak warning from ASAN. Change-Id: Icd3ff19c607da790a4a093966e1966cb0df6bb9d Reviewed-on: https://code.wireshark.org/review/9069 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tshark.c b/tshark.c
index ee983d6758..10394d1eb3 100644
--- a/tshark.c
+++ b/tshark.c
@@ -1085,6 +1085,8 @@ DIAG_ON(cast-qual)
"\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
@@ -1652,7 +1654,9 @@ DIAG_ON(cast-qual)
}
break;
case 'v': /* Show version and exit */
- {
+ comp_info_str = get_compiled_version_info(get_tshark_compiled_version_info,
+ epan_get_compiled_version_info);
+ runtime_info_str = get_runtime_version_info(get_tshark_runtime_version_info);
show_version("TShark (Wireshark)", comp_info_str, runtime_info_str);
g_string_free(comp_info_str, TRUE);
g_string_free(runtime_info_str, TRUE);
@@ -1663,7 +1667,6 @@ DIAG_ON(cast-qual)
* much more useful. */
epan_cleanup();
return 0;
- }
case 'O': /* Only output these protocols */
/* already processed; just ignore it now */
break;