diff options
-rw-r--r-- | epan/proto.c | 15 | ||||
-rw-r--r-- | epan/tap.c | 15 |
2 files changed, 18 insertions, 12 deletions
diff --git a/epan/proto.c b/epan/proto.c index cb3ed93125..6484b6bab1 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -499,6 +499,13 @@ register_dissector_plugin_type(void) { add_plugin_type("dissector", check_for_dissector_plugin); } + +static void +dissector_plugin_destroy(gpointer p) +{ + g_free(p); +} + #endif /* HAVE_PLUGINS */ /* initialize data structures and register protocols and fields */ @@ -576,12 +583,6 @@ proto_init(void (register_all_protocols_func)(register_cb cb, gpointer client_da } static void -dissector_plugin_destroy(gpointer p) -{ - g_free(p); -} - -static void proto_cleanup_base(void) { protocol_t *protocol; @@ -664,10 +665,12 @@ proto_cleanup(void) { proto_cleanup_base(); +#ifdef HAVE_PLUGINS if (dissector_plugins) { g_slist_free_full(dissector_plugins, dissector_plugin_destroy); dissector_plugins = NULL; } +#endif } static gboolean diff --git a/epan/tap.c b/epan/tap.c index c10dff4f0d..3d61203587 100644 --- a/epan/tap.c +++ b/epan/tap.c @@ -177,6 +177,13 @@ register_all_plugin_tap_listeners(void) { g_slist_foreach(tap_plugins, register_tap_plugin_listener, NULL); } + +static void +tap_plugin_destroy(gpointer p) +{ + g_free(p); +} + #endif /* HAVE_PLUGINS */ /* ********************************************************************** @@ -744,12 +751,6 @@ union_of_tap_listener_flags(void) return flags; } -static void -tap_plugin_destroy(gpointer p) -{ - g_free(p); -} - void tap_cleanup(void) { volatile tap_listener_t *elem_lq; @@ -770,7 +771,9 @@ void tap_cleanup(void) g_free((gpointer)elem_dl); } +#ifdef HAVE_PLUGINS g_slist_free_full(tap_plugins, tap_plugin_destroy); +#endif } /* |