aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/epan.c1
-rw-r--r--epan/tap.c21
-rw-r--r--epan/tap.h4
3 files changed, 26 insertions, 0 deletions
diff --git a/epan/epan.c b/epan/epan.c
index f1451940f6..85472416bf 100644
--- a/epan/epan.c
+++ b/epan/epan.c
@@ -217,6 +217,7 @@ epan_cleanup(void)
conversation_table_cleanup();
conversation_filters_cleanup();
reassembly_table_cleanup();
+ tap_cleanup();
packet_cleanup();
expert_cleanup();
capture_dissector_cleanup();
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
*
diff --git a/epan/tap.h b/epan/tap.h
index c3b427f008..edaaa31474 100644
--- a/epan/tap.h
+++ b/epan/tap.h
@@ -259,6 +259,10 @@ WS_DLL_PUBLIC guint union_of_tap_listener_flags(void);
*/
WS_DLL_PUBLIC const void *fetch_tapped_data(int tap_id, int idx);
+/** Clean internal structures
+ */
+extern void tap_cleanup(void);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */