summaryrefslogtreecommitdiff
path: root/epan/packet.c
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2017-01-16 22:49:28 +0100
committerMichael Mann <mmann78@netscape.net>2017-01-17 15:40:15 +0000
commit57f530a7fe06ff7325804a4a2a2aac6cd657ba02 (patch)
tree72b8b880ee367c3dce8092621362e0ad8532c94b /epan/packet.c
parentbaaff60b3be77a12f952b08b8d7b535f2f91949d (diff)
downloadwireshark-57f530a7fe06ff7325804a4a2a2aac6cd657ba02.tar.gz
packet: free init/cleanup functions lists.
Change-Id: Ia28ceef189f8fe16105da88c01e1a159d5029c0a Reviewed-on: https://code.wireshark.org/review/19655 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/packet.c')
-rw-r--r--epan/packet.c14
1 files 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))
{