From 57f530a7fe06ff7325804a4a2a2aac6cd657ba02 Mon Sep 17 00:00:00 2001 From: Dario Lombardo Date: Mon, 16 Jan 2017 22:49:28 +0100 Subject: packet: free init/cleanup functions lists. Change-Id: Ia28ceef189f8fe16105da88c01e1a159d5029c0a Reviewed-on: https://code.wireshark.org/review/19655 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/packet.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/epan/packet.c b/epan/packet.c index 01425f105a..d0e4efb7bf 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -121,6 +121,12 @@ struct depend_dissector_list { /* Maps char *dissector_name to depend_dissector_list_t */ static GHashTable *depend_dissector_lists = NULL; +/* List of routines that are called before we make a pass through a capture file + * and dissect all its packets. See register_init_routine and + * register_cleanup_routine in packet.h */ +static GSList *init_routines = NULL; +static GSList *cleanup_routines = NULL; + static void destroy_depend_dissector_list(void *data) { @@ -212,6 +218,8 @@ packet_cache_proto_handles(void) void packet_cleanup(void) { + g_slist_free(init_routines); + g_slist_free(cleanup_routines); g_hash_table_destroy(dissector_tables); g_hash_table_destroy(registered_dissectors); g_hash_table_destroy(depend_dissector_lists); @@ -237,12 +245,6 @@ set_actual_length(tvbuff_t *tvb, const guint specified_len) } } -/* List of routines that are called before we make a pass through a capture file - * and dissect all its packets. See register_init_routine and - * register_cleanup_routine in packet.h */ -static GSList *init_routines = NULL; -static GSList *cleanup_routines = NULL; - void register_init_routine(void (*func)(void)) { -- cgit v1.2.3