summaryrefslogtreecommitdiff
path: root/epan/disabled_protos.c
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2017-01-19 22:32:51 +0100
committerDario Lombardo <lomato@gmail.com>2017-01-20 08:49:00 +0000
commit5c0003a980f2f6de474b225aa99229701e7f3c11 (patch)
treeadd2fac08e75e2265d29c00615b1d8faa2e4064f /epan/disabled_protos.c
parent387e7af2180327774beaa86cee3f9528146141cf (diff)
downloadwireshark-5c0003a980f2f6de474b225aa99229701e7f3c11.tar.gz
disabled_protos: add cleanup function.
Change-Id: I7d585404463691946e2aa67e14e53edb813d9be8 Reviewed-on: https://code.wireshark.org/review/19681 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
Diffstat (limited to 'epan/disabled_protos.c')
-rw-r--r--epan/disabled_protos.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/epan/disabled_protos.c b/epan/disabled_protos.c
index ae6b5101e8..b38ad425a0 100644
--- a/epan/disabled_protos.c
+++ b/epan/disabled_protos.c
@@ -942,6 +942,27 @@ proto_enable_heuristic_by_name(const char *name, gboolean enable)
}
}
+static void
+disabled_protos_free(gpointer p, gpointer user_data _U_)
+{
+ protocol_def* pd = (protocol_def*)p;
+ g_free(pd->name);
+ g_free(p);
+}
+
+void
+disabled_protos_cleanup(void)
+{
+ g_list_foreach(global_disabled_heuristics, disabled_protos_free, NULL);
+ g_list_free(global_disabled_heuristics);
+ g_list_foreach(disabled_heuristics, disabled_protos_free, NULL);
+ g_list_free(disabled_heuristics);
+ g_list_foreach(global_disabled_protos, disabled_protos_free, NULL);
+ g_list_free(global_disabled_protos);
+ g_list_foreach(disabled_protos, disabled_protos_free, NULL);
+ g_list_free(disabled_protos);
+}
+
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*