diff options
author | Dario Lombardo <lomato@gmail.com> | 2017-01-24 14:19:22 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-02-04 13:25:14 +0000 |
commit | 0b25b1ab072c559fc897348dce286ee32ff7308b (patch) | |
tree | ebc31455c30378f842f86f65c8babc1c7b289a5e /epan | |
parent | e59583624cec7a3bed0aab95a365afe0f3e64397 (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')
-rw-r--r-- | epan/epan.c | 1 | ||||
-rw-r--r-- | epan/tap.c | 21 | ||||
-rw-r--r-- | epan/tap.h | 4 |
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 */ |