aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tap.c
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2017-01-24 14:19:22 +0100
committerMichael Mann <mmann78@netscape.net>2017-02-04 13:25:14 +0000
commit0b25b1ab072c559fc897348dce286ee32ff7308b (patch)
treeebc31455c30378f842f86f65c8babc1c7b289a5e /epan/tap.c
parente59583624cec7a3bed0aab95a365afe0f3e64397 (diff)
tap: add cleanup routine.
Change-Id: I460b053880ed43a7377b7696531bbaeb0fd0d68b Reviewed-on: https://code.wireshark.org/review/19764 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/tap.c')
-rw-r--r--epan/tap.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/epan/tap.c b/epan/tap.c
index fc626db039..623ad04451 100644
--- a/epan/tap.c
+++ b/epan/tap.c
@@ -744,6 +744,27 @@ union_of_tap_listener_flags(void)
return flags;
}
+void tap_cleanup(void)
+{
+ volatile tap_listener_t *elem_lq;
+ volatile tap_listener_t *head_lq = tap_listener_queue;
+ tap_dissector_t *elem_dl;
+ tap_dissector_t *head_dl = tap_dissector_list;
+
+ while(head_lq){
+ elem_lq = head_lq;
+ head_lq = head_lq->next;
+ free_tap_listener(elem_lq);
+ }
+
+ while(head_dl){
+ elem_dl = head_dl;
+ head_dl = head_dl->next;
+ g_free((char*)elem_dl->name);
+ g_free((gpointer)elem_dl);
+ }
+}
+
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*