summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2017-01-16 22:08:12 +0100
committerMichael Mann <mmann78@netscape.net>2017-01-17 15:39:58 +0000
commitbaaff60b3be77a12f952b08b8d7b535f2f91949d (patch)
treeed280f2442aa485845dc02ff867f861b959b3a64
parentbaf2612d9e23cb2d992f75b0a21e26a28f3985cc (diff)
downloadwireshark-baaff60b3be77a12f952b08b8d7b535f2f91949d.tar.gz
exported_object: add cleanup function.
Change-Id: If4c35d18db1dc982e981004838e0eabbf4479e78 Reviewed-on: https://code.wireshark.org/review/19653 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/epan.c2
-rw-r--r--epan/export_object.c15
-rw-r--r--epan/export_object.h4
3 files changed, 21 insertions, 0 deletions
diff --git a/epan/epan.c b/epan/epan.c
index cf578f1c69..0b12a690e7 100644
--- a/epan/epan.c
+++ b/epan/epan.c
@@ -55,6 +55,7 @@
#include "print.h"
#include "capture_dissectors.h"
#include "exported_pdu.h"
+#include "export_object.h"
#ifdef HAVE_LUA
#include <lua.h>
@@ -207,6 +208,7 @@ epan_cleanup(void)
expert_cleanup();
capture_dissector_cleanup();
export_pdu_cleanup();
+ export_object_cleanup();
#ifdef HAVE_LUA
wslua_cleanup();
#endif
diff --git a/epan/export_object.c b/epan/export_object.c
index 495609b6b1..d5e4c0eed6 100644
--- a/epan/export_object.c
+++ b/epan/export_object.c
@@ -197,6 +197,21 @@ void eo_free_entry(export_object_entry_t *entry)
g_free(entry);
}
+
+static void
+free_eo_table(gpointer p, gpointer user_data _U_)
+{
+ register_eo_t *table = (register_eo_t*)p;
+ g_free((gpointer)table->tap_listen_str);
+ g_free(table);
+}
+
+void export_object_cleanup(void)
+{
+ g_slist_foreach(registered_eo_tables, free_eo_table, NULL);
+ g_slist_free(registered_eo_tables);
+}
+
/*
* Editor modelines
*
diff --git a/epan/export_object.h b/epan/export_object.h
index bd068e87c4..475b1d8f0d 100644
--- a/epan/export_object.h
+++ b/epan/export_object.h
@@ -135,6 +135,10 @@ WS_DLL_PUBLIC const char *eo_ct2ext(const char *content_type);
*/
WS_DLL_PUBLIC void eo_free_entry(export_object_entry_t *entry);
+/** Free the export objects table
+ */
+extern void export_object_cleanup(void);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */