aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/main.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 /ui/gtk/main.c
parent0285fb9e215ae0f3859f314c3eb03e69ad2fd3ff (diff)
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 'ui/gtk/main.c')
-rw-r--r--ui/gtk/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/gtk/main.c b/ui/gtk/main.c
index 8eab2b5b55..fe6fa5b26e 100644
--- a/ui/gtk/main.c
+++ b/ui/gtk/main.c
@@ -3181,6 +3181,9 @@ main(int argc, char *argv[])
/* the window can be sized only, if it's not already shown, so do it now! */
main_load_window_geometry(top_level);
+ /* initialize the packet counters */
+ global_info_data.counts.counts_hash = NULL;
+
g_timeout_add(info_update_freq, resolv_update_cb, NULL);
/* If we were given the name of a capture file, read it in now;