summaryrefslogtreecommitdiff
path: root/epan
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2017-01-20 12:19:18 +0100
committerMichael Mann <mmann78@netscape.net>2017-01-21 00:26:50 +0000
commitfecf0d847e012bf4e73aa66da02166774acba65d (patch)
tree048b7054d8d0e8cd2e249987cb9a1389f536c18c /epan
parent7e03647c9d756f8290fcc0c81eb1e4df0fc1c80c (diff)
downloadwireshark-fecf0d847e012bf4e73aa66da02166774acba65d.tar.gz
dissector_filters: add cleanup function.
Change-Id: I9694a8e817e357061a60c425fb5881d525ed8143 Reviewed-on: https://code.wireshark.org/review/19695 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissector_filters.c11
-rw-r--r--epan/dissector_filters.h3
-rw-r--r--epan/epan.c2
3 files changed, 16 insertions, 0 deletions
diff --git a/epan/dissector_filters.c b/epan/dissector_filters.c
index 8b84f5ec15..13a02c6c44 100644
--- a/epan/dissector_filters.c
+++ b/epan/dissector_filters.c
@@ -62,6 +62,17 @@ struct conversation_filter_s* find_conversation_filter(const char *name)
return NULL;
}
+static void conversation_filter_free(gpointer p, gpointer user_data _U_)
+{
+ g_free(p);
+}
+
+void conversation_filters_cleanup(void)
+{
+ g_list_foreach(conv_filter_list, conversation_filter_free, NULL);
+ g_list_free(conv_filter_list);
+}
+
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
diff --git a/epan/dissector_filters.h b/epan/dissector_filters.h
index fe5443b0de..44bca5d79b 100644
--- a/epan/dissector_filters.h
+++ b/epan/dissector_filters.h
@@ -46,6 +46,9 @@ WS_DLL_PUBLIC void register_conversation_filter(const char *proto_name, const ch
WS_DLL_PUBLIC struct conversation_filter_s* find_conversation_filter(const char *proto_name);
+/* Cleanup internal structures */
+extern void conversation_filters_cleanup(void);
+
/*** THE FOLLOWING SHOULD NOT BE USED BY ANY DISSECTORS!!! ***/
typedef struct conversation_filter_s {
diff --git a/epan/epan.c b/epan/epan.c
index 1252f1e793..1ad91b2395 100644
--- a/epan/epan.c
+++ b/epan/epan.c
@@ -60,6 +60,7 @@
#include "follow.h"
#include "disabled_protos.h"
#include "decode_as.h"
+#include "dissector_filters.h"
#ifdef HAVE_LUA
#include <lua.h>
@@ -209,6 +210,7 @@ epan_cleanup(void)
proto_cleanup();
prefs_cleanup();
decode_clear_all();
+ conversation_filters_cleanup();
packet_cleanup();
expert_cleanup();
capture_dissector_cleanup();