summaryrefslogtreecommitdiff
path: root/tshark.c
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2015-12-23 10:10:55 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2015-12-23 11:35:25 +0000
commit35ee09e0f0dfccc0db23a7b34548943ef54a6a74 (patch)
tree0711ae6740e701ab961b68bae53dc681cd96386e /tshark.c
parent0285fb9e215ae0f3859f314c3eb03e69ad2fd3ff (diff)
downloadwireshark-35ee09e0f0dfccc0db23a7b34548943ef54a6a74.tar.gz
capture_info: Fix initialization of packet counter
g_hash_table_destroy will crash, if it is called on non-initialized memory. For some reason, this does not happen with other glib lists (e.g. GList seems to guard cleanly). This change initializes at the earliest possible time the packet counter hash with NULL Change-Id: Ice66652fc9639d10b49d006ecbe80efe3f41e2ff Reviewed-on: https://code.wireshark.org/review/12841 Reviewed-by: Roland Knall <rknall@gmail.com> Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tshark.c b/tshark.c
index c5d4fb6ffc..c603dc584f 100644
--- a/tshark.c
+++ b/tshark.c
@@ -2564,6 +2564,9 @@ capture(void)
fflush(stderr);
g_string_free(str, TRUE);
+ /* initialize the counts hash with null */
+ global_info_data.counts.counts_hash = NULL;
+
ret = sync_pipe_start(&global_capture_opts, &global_capture_session, &global_info_data, NULL);
if (!ret)