diff options
author | Dario Lombardo <lomato@gmail.com> | 2017-01-20 14:52:05 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-01-21 00:27:25 +0000 |
commit | d020990f0356f4793e00209ae99e9f2dd7b843c9 (patch) | |
tree | 933ddfc7a9a7f13fc862f3d047a853956985ed3b | |
parent | fecf0d847e012bf4e73aa66da02166774acba65d (diff) |
conversation_table: add cleanup function.
Change-Id: Icea963384c16b1ad5387a885219d0621b470181b
Reviewed-on: https://code.wireshark.org/review/19699
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r-- | epan/conversation_table.c | 13 | ||||
-rw-r--r-- | epan/conversation_table.h | 4 | ||||
-rw-r--r-- | epan/epan.c | 2 |
3 files changed, 19 insertions, 0 deletions
diff --git a/epan/conversation_table.c b/epan/conversation_table.c index db6e972aab..f64b36694d 100644 --- a/epan/conversation_table.c +++ b/epan/conversation_table.c @@ -828,6 +828,19 @@ add_hostlist_table_data(conv_hash_t *ch, const address *addr, guint32 port, gboo } } +static void +ct_table_free(gpointer p, gpointer user_data _U_) +{ + g_free(p); +} + +void +conversation_table_cleanup(void) +{ + g_slist_foreach(registered_ct_tables, ct_table_free, NULL); + g_slist_free(registered_ct_tables); +} + /* * Editor modelines * diff --git a/epan/conversation_table.h b/epan/conversation_table.h index c0871924e2..ba94029bd9 100644 --- a/epan/conversation_table.h +++ b/epan/conversation_table.h @@ -340,6 +340,10 @@ add_conversation_table_data_with_conv_id(conv_hash_t *ch, const address *src, co void add_hostlist_table_data(conv_hash_t *ch, const address *addr, guint32 port, gboolean sender, int num_frames, int num_bytes, hostlist_dissector_info_t *host_info, port_type port_type_val); +/** Cleanup internal structures + */ +void conversation_table_cleanup(void); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/epan/epan.c b/epan/epan.c index 1ad91b2395..10dba580f7 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -61,6 +61,7 @@ #include "disabled_protos.h" #include "decode_as.h" #include "dissector_filters.h" +#include "conversation_table.h" #ifdef HAVE_LUA #include <lua.h> @@ -210,6 +211,7 @@ epan_cleanup(void) proto_cleanup(); prefs_cleanup(); decode_clear_all(); + conversation_table_cleanup(); conversation_filters_cleanup(); packet_cleanup(); expert_cleanup(); |