Revert "tap: change glib functions to wmem."
authorPascal Quantin <pascal.quantin@gmail.com>
Sun, 19 Jun 2016 09:01:56 +0000 (11:01 +0200)
committerPascal Quantin <pascal.quantin@gmail.com>
Sun, 19 Jun 2016 10:47:10 +0000 (10:47 +0000)
This reverts commit 2e9f3c5d366eaa7139fc877b5301392166b3f985.

It breaks the registration of codec, dissector and libwiretap plugins.

Change-Id: I4ef91dd192f765adf87ea9fe9f3693e25dbd24de
Reviewed-on: https://code.wireshark.org/review/16012
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
84 files changed:
dftest.c
epan/dissectors/packet-smb-sidsnooping.c
epan/dissectors/packet-smb.c
epan/dissectors/packet-smb2.c
epan/epan.c
epan/tap.c
epan/tap.h
epan/wslua/wslua_field.c
epan/wslua/wslua_listener.c
plugins/mate/packet-mate.c
rawshark.c
tfshark.c
tshark.c
ui/cli/tap-camelsrt.c
ui/cli/tap-comparestat.c
ui/cli/tap-diameter-avp.c
ui/cli/tap-endpoints.c
ui/cli/tap-expert.c
ui/cli/tap-follow.c
ui/cli/tap-gsm_astat.c
ui/cli/tap-hosts.c
ui/cli/tap-httpstat.c
ui/cli/tap-icmpstat.c
ui/cli/tap-icmpv6stat.c
ui/cli/tap-iostat.c
ui/cli/tap-iousers.c
ui/cli/tap-macltestat.c
ui/cli/tap-protocolinfo.c
ui/cli/tap-protohierstat.c
ui/cli/tap-rlcltestat.c
ui/cli/tap-rpcprogs.c
ui/cli/tap-rtd.c
ui/cli/tap-rtp.c
ui/cli/tap-rtspstat.c
ui/cli/tap-sctpchunkstat.c
ui/cli/tap-simple_stattable.c
ui/cli/tap-sipstat.c
ui/cli/tap-smbsids.c
ui/cli/tap-srt.c
ui/cli/tap-stats_tree.c
ui/cli/tap-sv.c
ui/cli/tap-wspstat.c
ui/gtk/compare_stat.c
ui/gtk/conversations_table.c
ui/gtk/dcerpc_stat.c
ui/gtk/expert_comp_dlg.c
ui/gtk/export_object_dlg.c
ui/gtk/follow_stream.c
ui/gtk/gsm_map_summary.c
ui/gtk/hostlist_table.c
ui/gtk/iax2_analysis.c
ui/gtk/io_stat.c
ui/gtk/lbm_stream_dlg.c
ui/gtk/lbm_uimflow_dlg.c
ui/gtk/mac_lte_stat_dlg.c
ui/gtk/main.c
ui/gtk/mtp3_summary.c
ui/gtk/response_time_delay_table.c
ui/gtk/rlc_lte_stat_dlg.c
ui/gtk/rpc_stat.c
ui/gtk/rtp_analysis.c
ui/gtk/sctp_chunk_stat.c
ui/gtk/service_response_time_table.c
ui/gtk/simple_stattable.c
ui/gtk/stats_tree_stat.c
ui/gtk/wlan_stat_dlg.c
ui/mcast_stream.c
ui/qt/bluetooth_device_dialog.cpp
ui/qt/bluetooth_hci_summary_dialog.cpp
ui/qt/expert_info_dialog.cpp
ui/qt/gsm_map_summary_dialog.cpp
ui/qt/io_graph_dialog.cpp
ui/qt/lbm_lbtrm_transport_dialog.cpp
ui/qt/lbm_lbtru_transport_dialog.cpp
ui/qt/lbm_stream_dialog.cpp
ui/qt/mtp3_summary_dialog.cpp
ui/qt/wireshark_dialog.cpp
ui/rtp_stream.c
ui/tap-rlc-graph.c
ui/tap-sctp-analysis.c
ui/tap-tcp-stream.c
ui/tap_export_pdu.c
ui/voip_calls.c
wireshark-qt.cpp

index 1bd146ee7e55c01f90f9366d8d97e9f08a90207c..9b4276ecac2f49349e1e51c166533f62257cc8cd 100644 (file)
--- a/dftest.c
+++ b/dftest.c
@@ -82,6 +82,15 @@ main(int argc, char **argv)
        timestamp_set_type(TS_RELATIVE);
        timestamp_set_seconds_type(TS_SECONDS_DEFAULT);
 
+#ifdef HAVE_PLUGINS
+       /* Register all the plugin types we have. */
+       epan_register_plugin_types(); /* Types known to libwireshark */
+
+       /* Scan for plugins.  This does *not* call their registration routines;
+          that's done later. */
+       scan_plugins();
+#endif
+
        /* Register all dissectors; we must do this before checking for the
           "-g" flag, as the "-g" flag dumps a list of fields registered
           by the dissectors, and we must do it before we read the preferences,
index 15adff80339cfa30cc025c0c6be754bf63e19c27..3a2ff1628c4be00aa8923a52bd56520b40c70c42 100644 (file)
@@ -263,7 +263,7 @@ ctx_handle_hash(gconstpointer k)
 static void
 sid_snooping_init(void)
 {
-       gchar *error_string;
+       GString *error_string;
 
        if(lsa_policy_information_tap_installed){
                remove_tap_listener(&lsa_policy_information_tap_installed);
@@ -310,8 +310,8 @@ sid_name_snooping=FALSE;
                /* error, we failed to attach to the tap. clean up */
 
                report_failure( "Couldn't register proto_reg_handoff_smb_sidsnooping()/lsa_policy_information tap: %s\n",
-                   error_string);
-               wmem_free(NULL, error_string);
+                   error_string->str);
+               g_string_free(error_string, TRUE);
                return;
        }
        lsa_policy_information_tap_installed=TRUE;
@@ -324,8 +324,8 @@ sid_name_snooping=FALSE;
                /* error, we failed to attach to the tap. clean up */
 
                report_failure( "Couldn't register proto_reg_handoff_smb_sidsnooping()/samr_query_dispinfo tap: %s\n",
-                   error_string);
-               wmem_free(NULL, error_string);
+                   error_string->str);
+               g_string_free(error_string, TRUE);
                return;
        }
        samr_query_dispinfo_tap_installed=TRUE;
index a73662833f246bdb107af6c23bdaf4cea496f2f0..9ce5fb651e53b357a671253945c85b80fa32b431 100644 (file)
@@ -6887,7 +6887,7 @@ dissect_session_setup_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
        const ntlmssp_header_t *ntlmssph;
 
        if (!ntlmssp_tap_id) {
-               gchar *error_string;
+               GString *error_string;
                /* We don't specify any callbacks at all.
                 * Instead we manually fetch the tapped data after the
                 * security blob has been fully dissected and before
@@ -6898,7 +6898,7 @@ dissect_session_setup_andx_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
                if (!error_string) {
                        ntlmssp_tap_id = find_tap_id("ntlmssp");
                } else {
-                       wmem_free(NULL, error_string);
+                       g_string_free(error_string, TRUE);
                }
        }
 
index a8f1ebe81000c30c1b42d4946592b4b5de984614..7e82d2cbdda78d655d8ab280242a04ad854ca254 100644 (file)
@@ -2772,7 +2772,7 @@ dissect_smb2_session_setup_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
        int        idx;
 
        if (!ntlmssp_tap_id) {
-               gchar *error_string;
+               GString *error_string;
                /* We don't specify any callbacks at all.
                 * Instead we manually fetch the tapped data after the
                 * security blob has been fully dissected and before
@@ -2783,7 +2783,7 @@ dissect_smb2_session_setup_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree
                if (!error_string) {
                        ntlmssp_tap_id = find_tap_id("ntlmssp");
                } else {
-                       wmem_free(NULL, error_string);
+                       g_string_free(error_string, TRUE);
                }
        }
 
index 82c5168297dd845b5a23b9b05b911e5a7e7ce76f..092717257085e5d4eb16ab3740fa591da8bfa5ec 100644 (file)
@@ -24,7 +24,6 @@
 #include <stdarg.h>
 
 #include <wsutil/wsgcrypt.h>
-#include <wsutil/plugins.h>
 
 #ifdef HAVE_LIBGNUTLS
 #include <gnutls/gnutls.h>
@@ -119,12 +118,6 @@ epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer client_da
 #ifdef HAVE_LIBGNUTLS
        gnutls_global_init();
 #endif
-
-#ifdef HAVE_PLUGINS
-       /* Register all the plugin types we have. */
-       epan_register_plugin_types(); /* Types known to libwireshark */
-#endif
-
        TRY {
                tap_init();
                prefs_init();
@@ -162,13 +155,6 @@ epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer client_da
                status = FALSE;
        }
        ENDTRY;
-
-#ifdef HAVE_PLUGINS
-       /* Scan for plugins.  This does *not* call their registration routines;
-       that's done later. */
-       scan_plugins();
-#endif
-
        return status;
 }
 
index 129223fc0e4d7f90fb8daf2979e7ca07b95f4b55..1348e375dd0a5fd1a7a89b72882229b9449b1496 100644 (file)
@@ -39,7 +39,6 @@
 #include <epan/packet_info.h>
 #include <epan/dfilter/dfilter.h>
 #include <epan/tap.h>
-#include <epan/wmem/wmem_list.h>
 
 static gboolean tapping_is_active=FALSE;
 
@@ -119,7 +118,7 @@ typedef struct {
        void (*register_tap_listener_fn)(void);   /* routine to call to register tap listener */
 } tap_plugin;
 
-static wmem_list_t *tap_plugins = NULL;
+static GSList *tap_plugins = NULL;
 
 /*
  * Callback for each plugin found.
@@ -149,9 +148,9 @@ DIAG_ON(pedantic)
        /*
         * Add this one to the list of tap plugins.
         */
-       plugin = wmem_new(NULL, tap_plugin);
+       plugin = (tap_plugin *)g_malloc(sizeof (tap_plugin));
        plugin->register_tap_listener_fn = register_tap_listener_fn;
-       wmem_list_append(tap_plugins, plugin);
+       tap_plugins = g_slist_append(tap_plugins, plugin);
        return TRUE;
 }
 
@@ -175,7 +174,7 @@ register_tap_plugin_listener(gpointer data, gpointer user_data _U_)
 void
 register_all_plugin_tap_listeners(void)
 {
-       wmem_list_foreach(tap_plugins, register_tap_plugin_listener, NULL);
+       g_slist_foreach(tap_plugins, register_tap_plugin_listener, NULL);
 }
 #endif /* HAVE_PLUGINS */
 
@@ -189,7 +188,6 @@ void
 tap_init(void)
 {
        tap_packet_index=0;
-       tap_plugins = wmem_list_new(NULL);
 }
 
 /* **********************************************************************
@@ -224,9 +222,9 @@ register_tap(const char *name)
                        return tap_id;
        }
 
-       td=wmem_new(NULL, tap_dissector_t);
+       td=(tap_dissector_t *)g_malloc(sizeof(tap_dissector_t));
        td->next=NULL;
-       td->name = wmem_strdup(NULL, name);
+       td->name = g_strdup(name);
 
        if(!tap_dissector_list){
                tap_dissector_list=td;
@@ -508,8 +506,10 @@ free_tap_listener(volatile tap_listener_t *tl)
        if(tl->code){
                dfilter_free(tl->code);
        }
-       wmem_free(NULL, tl->fstring);
-       wmem_free(NULL, (void*)tl);
+       g_free(tl->fstring);
+DIAG_OFF(cast-qual)
+       g_free((gpointer)tl);
+DIAG_ON(cast-qual)
 }
 
 /* this function attaches the tap_listener to the named tap.
@@ -518,28 +518,30 @@ free_tap_listener(volatile tap_listener_t *tl)
  * non-NULL: error, return value points to GString containing error
  *           message.
  */
-gchar *
+GString *
 register_tap_listener(const char *tapname, void *tapdata, const char *fstring,
                      guint flags, tap_reset_cb reset, tap_packet_cb packet, tap_draw_cb draw)
 {
        volatile tap_listener_t *tl;
        int tap_id;
        dfilter_t *code=NULL;
-       gchar *error_string = NULL;
+       GString *error_string;
        gchar *err_msg;
 
        tap_id=find_tap_id(tapname);
        if(!tap_id){
-               error_string = wmem_strdup_printf(NULL, "Tap %s not found", tapname);
+               error_string = g_string_new("");
+               g_string_printf(error_string, "Tap %s not found", tapname);
                return error_string;
        }
 
-       tl=wmem_new0(NULL, volatile tap_listener_t);
+       tl=(volatile tap_listener_t *)g_malloc0(sizeof(tap_listener_t));
        tl->needs_redraw=TRUE;
        tl->flags=flags;
        if(fstring){
                if(!dfilter_compile(fstring, &code, &err_msg)){
-                       error_string = wmem_strdup_printf(NULL,
+                       error_string = g_string_new("");
+                       g_string_printf(error_string,
                            "Filter \"%s\" is invalid - %s",
                            fstring, err_msg);
                        g_free(err_msg);
@@ -547,7 +549,7 @@ register_tap_listener(const char *tapname, void *tapdata, const char *fstring,
                        return error_string;
                }
        }
-       tl->fstring=wmem_strdup(NULL, fstring);
+       tl->fstring=g_strdup(fstring);
        tl->code=code;
 
        tl->tap_id=tap_id;
@@ -564,12 +566,12 @@ register_tap_listener(const char *tapname, void *tapdata, const char *fstring,
 
 /* this function sets a new dfilter to a tap listener
  */
-gchar *
+GString *
 set_tap_dfilter(void *tapdata, const char *fstring)
 {
        volatile tap_listener_t *tl=NULL,*tl2;
        dfilter_t *code=NULL;
-       gchar *error_string;
+       GString *error_string;
        gchar *err_msg;
 
        if(!tap_listener_queue){
@@ -594,19 +596,19 @@ set_tap_dfilter(void *tapdata, const char *fstring)
                        tl->code=NULL;
                }
                tl->needs_redraw=TRUE;
-               wmem_free(NULL, tl->fstring);
+               g_free(tl->fstring);
                if(fstring){
                        if(!dfilter_compile(fstring, &code, &err_msg)){
                                tl->fstring=NULL;
-                               error_string = wmem_strdup_printf(
-                                               NULL,
+                               error_string = g_string_new("");
+                               g_string_printf(error_string,
                                                 "Filter \"%s\" is invalid - %s",
                                                 fstring, err_msg);
-                               wmem_free(NULL, err_msg);
+                               g_free(err_msg);
                                return error_string;
                        }
                }
-               tl->fstring=wmem_strdup(NULL, fstring);
+               tl->fstring=g_strdup(fstring);
                tl->code=code;
        }
 
index c17bafcd5e6d9030fc5aa6d996365a9040261de0..c3b427f00843134c32946a29ff89e9baf607f764 100644 (file)
@@ -140,8 +140,8 @@ WS_DLL_PUBLIC void draw_tap_listeners(gboolean draw_all);
 /** this function attaches the tap_listener to the named tap.
  * function returns :
  *     NULL: ok.
- * non-NULL: error, return value points to gchar* containing error
- *           message. This value must be freed with wmem_free().
+ * non-NULL: error, return value points to GString containing error
+ *           message.
  * @param tapname    The name of the tap we want to listen to.
  * @param tapdata    is the instance identifier. The tap system uses the value of this
  *                   pointer to distinguish between different instances of a tap.
@@ -211,12 +211,12 @@ WS_DLL_PUBLIC void draw_tap_listeners(gboolean draw_all);
  *                   or the file has been [re]read completely.
  */
 
-WS_DLL_PUBLIC gchar *register_tap_listener(const char *tapname, void *tapdata,
+WS_DLL_PUBLIC GString *register_tap_listener(const char *tapname, void *tapdata,
     const char *fstring, guint flags, tap_reset_cb tap_reset,
     tap_packet_cb tap_packet, tap_draw_cb tap_draw);
 
 /** This function sets a new dfilter to a tap listener */
-WS_DLL_PUBLIC gchar *set_tap_dfilter(void *tapdata, const char *fstring);
+WS_DLL_PUBLIC GString *set_tap_dfilter(void *tapdata, const char *fstring);
 
 /** This function recompiles dfilter for all registered tap listeners */
 WS_DLL_PUBLIC void tap_listeners_dfilter_recompile(void);
index 5707300be95f80a8f49c37e411530f07a68b0df1..d64513c5a2f77e2011c6ce1ecd2a65df58a2bc88 100644 (file)
@@ -591,15 +591,15 @@ void lua_prime_all_fields(proto_tree* tree _U_) {
 
     if (fake_tap && fake_tap_filter->len > strlen("frame")) {
         /* a boring tap :-) */
-        gchar* error = register_tap_listener("frame",
+        GString* error = register_tap_listener("frame",
                 &fake_tap,
                 fake_tap_filter->str,
                 0, /* XXX - do we need the protocol tree or columns? */
                 NULL, NULL, NULL);
 
         if (error) {
-            report_failure("while registering lua_fake_tap:\n%s", error);
-            wmem_free(NULL, error);
+            report_failure("while registering lua_fake_tap:\n%s",error->str);
+            g_string_free(error,TRUE);
         } else if (!dfilter_compile(fake_tap_filter->str, &wslua_dfilter, &err_msg)) {
             report_failure("while compiling dfilter \"%s\" for wslua: %s", fake_tap_filter->str, err_msg);
             g_free(err_msg);
index 9d87ee5bbef454fba0751d158ea8f815ca9e0696..85caa7316c3dd897a914921544ea33621d6540d9 100644 (file)
@@ -210,7 +210,7 @@ WSLUA_CONSTRUCTOR Listener_new(lua_State* L) {
     const gchar* filter = luaL_optstring(L,WSLUA_OPTARG_Listener_new_FILTER,NULL);
     const gboolean all_fields = wslua_optbool(L, WSLUA_OPTARG_Listener_new_ALLFIELDS, FALSE);
     Listener tap;
-    gchar* error;
+    GString* error;
 
     tap = (Listener)g_malloc(sizeof(struct _wslua_tap));
 
@@ -237,8 +237,8 @@ WSLUA_CONSTRUCTOR Listener_new(lua_State* L) {
         g_free(tap->name);
         g_free(tap);
         /* WSLUA_ERROR(new_tap,"tap registration error"); */
-        lua_pushfstring(L,"Error while registering tap:\n%s",error);
-        wmem_free(NULL, error);
+        lua_pushfstring(L,"Error while registering tap:\n%s",error->str);
+        g_string_free(error,TRUE);
         luaL_error(L,lua_tostring(L,-1));
     }
 
index 98267e5d4ed3c887cc5fbfb34dce75de40b2ace4..5ece48b188b702a4af3afcb30b690cb825b97d95 100644 (file)
@@ -327,7 +327,7 @@ extern
 void
 proto_reg_handoff_mate(void)
 {
-       gchar* tap_error = NULL;
+       GString* tap_error = NULL;
 
        if ( *pref_mate_config_filename != '\0' ) {
 
@@ -354,8 +354,8 @@ proto_reg_handoff_mate(void)
                                    (tap_draw_cb) NULL);
 
                                if ( tap_error ) {
-                                       g_warning("mate: couldn't (re)register tap: %s", tap_error);
-                                       wmem_free(NULL, tap_error);
+                                       g_warning("mate: couldn't (re)register tap: %s",tap_error->str);
+                                       g_string_free(tap_error, TRUE);
                                        mate_tap_data = 0;
                                        return;
                                }
index ee7d3b4ce04cb1e4a9e9a150fedb47f60363b61a..cd59d9fdf93dc1fac573db902be31476655b301b 100644 (file)
@@ -1332,7 +1332,7 @@ protocolinfo_init(char *field)
 {
     pci_t *rs;
     header_field_info *hfi;
-    gchar *error_string;
+    GString *error_string;
     char hfibuf[100];
 
     hfi=proto_registrar_get_byname(field);
@@ -1356,8 +1356,8 @@ protocolinfo_init(char *field)
     if(error_string){
         /* error, we failed to attach to the tap. complain and clean up */
         fprintf(stderr, "rawshark: Couldn't register field extraction tap: %s\n",
-                error_string);
-        wmem_free(NULL, error_string);
+                error_string->str);
+        g_string_free(error_string, TRUE);
         if(rs->filter){
             g_free(rs->filter);
         }
index 653f7d826af97a194368382439a1795a89ae7ddc..ae267614e636ee8f540e14bb30f1ad2b6bbef135 100644 (file)
--- a/tfshark.c
+++ b/tfshark.c
@@ -913,6 +913,16 @@ main(int argc, char *argv[])
 
   init_open_routines();
 
+#ifdef HAVE_PLUGINS
+  /* Register all the plugin types we have. */
+  epan_register_plugin_types(); /* Types known to libwireshark */
+
+  /* Scan for plugins.  This does *not* call their registration routines;
+     that's done later. */
+  scan_plugins();
+
+#endif
+
   /* Register all dissectors; we must do this before checking for the
      "-G" flag, as the "-G" flag dumps information registered by the
      dissectors, and we must do it before we read the preferences, in
index 3df60d4dd52f7e4cac02c04e0ccd1dce28103bac..af38ab0702c6daf46d94486c2ede909474ba33fa 100644 (file)
--- a/tshark.c
+++ b/tshark.c
@@ -1196,8 +1196,14 @@ main(int argc, char *argv[])
   init_open_routines();
 
 #ifdef HAVE_PLUGINS
+  /* Register all the plugin types we have. */
+  epan_register_plugin_types(); /* Types known to libwireshark */
   wtap_register_plugin_types(); /* Types known to libwiretap */
 
+  /* Scan for plugins.  This does *not* call their registration routines;
+     that's done later. */
+  scan_plugins();
+
   /* Register all libwiretap plugin modules. */
   register_all_wiretap_modules();
 #endif
index 7e64bf6449cf13ef64f5b72b2a6a98e8d50a180a..6277d357d881b087926702ce5b86e551328d81a6 100644 (file)
@@ -210,7 +210,7 @@ static void camelsrt_draw(void *phs)
 static void camelsrt_init(const char *opt_arg, void *userdata _U_)
 {
   struct camelsrt_t *p_camelsrt;
-  gchar *error_string;
+  GString *error_string;
 
   p_camelsrt = g_new(struct camelsrt_t, 1);
   if (!strncmp(opt_arg, "camel,srt,", 9)) {
@@ -234,8 +234,8 @@ static void camelsrt_init(const char *opt_arg, void *userdata _U_)
     g_free(p_camelsrt);
 
     fprintf(stderr, "tshark: Couldn't register camel,srt tap: %s\n",
-            error_string);
-    wmem_free(NULL, error_string);
+            error_string->str);
+    g_string_free(error_string, TRUE);
     exit(1);
   }
 
index e11b1a132d5ad23fa73d9264b8d97f64d54d8816..286310103ab0d91a9996e3432b8181415ff35590 100644 (file)
@@ -530,7 +530,7 @@ comparestat_init(const char *opt_arg, void *userdata _U_)
 {
        comparestat_t *cs;
        const char *filter = NULL;
-       gchar *error_string;
+       GString *error_string;
        gint start, stop, ttl, order, pos = 0;
        gdouble variance;
 
@@ -581,8 +581,8 @@ comparestat_init(const char *opt_arg, void *userdata _U_)
                g_hash_table_destroy(cs->packet_set);
                g_free(cs);
 
-               fprintf(stderr, "tshark: Couldn't register compare tap: %s\n", error_string);
-               wmem_free(NULL, error_string);
+               fprintf(stderr, "tshark: Couldn't register compare tap: %s\n", error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 }
index 51223c8711562f987ca3b627474f10441eb31ce4..02106cd9f4aecabb5f6f1ec4547aeaa83c5150a2 100644 (file)
@@ -220,7 +220,7 @@ diameteravp_init(const char *opt_arg, void *userdata _U_)
        guint           opt_count    = 0;
        guint           opt_idx      = 0;
        GString        *filter       = NULL;
-       gchar          *error_string = NULL;
+       GString        *error_string = NULL;
 
        ds = g_new(diameteravp_t, 1);
        ds->frame             = 0;
@@ -263,8 +263,8 @@ diameteravp_init(const char *opt_arg, void *userdata _U_)
                g_free(ds);
 
                fprintf(stderr, "tshark: Couldn't register diam,csv tap: %s\n",
-                               error_string);
-               wmem_free(NULL, error_string);
+                               error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 }
index 9aec73604752340244a652331d0580ce3c0eebcc..5e261bd29b7f2885ecc9c76c0bcd6e4117431a2b 100644 (file)
@@ -113,7 +113,7 @@ endpoints_draw(void *arg)
 void init_hostlists(struct register_ct *ct, const char *filter)
 {
        endpoints_t *iu;
-       gchar *error_string;
+       GString *error_string;
 
        iu = g_new0(endpoints_t, 1);
        iu->type = proto_get_protocol_short_name(find_protocol_by_id(get_conversation_proto_id(ct)));
@@ -124,8 +124,8 @@ void init_hostlists(struct register_ct *ct, const char *filter)
        if (error_string) {
                g_free(iu);
                fprintf(stderr, "tshark: Couldn't register endpoint tap: %s\n",
-                   error_string);
-               wmem_free(NULL, error_string);
+                   error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 
index be92d150ddf91861716264c4a4145b1d48483e34..07fdfb5f6c7b2eb4f9476b093be4e603d2f86c8d 100644 (file)
@@ -195,7 +195,7 @@ static void expert_stat_init(const char *opt_arg, void *userdata _U_)
 {
     const char       *args   = NULL;
     const char       *filter = NULL;
-    gchar            *error_string;
+    GString          *error_string;
     expert_tapdata_t *hs;
     int               n;
 
@@ -257,8 +257,8 @@ static void expert_stat_init(const char *opt_arg, void *userdata _U_)
                                          expert_stat_packet,
                                          expert_stat_draw);
     if (error_string) {
-        printf("Expert tap error (%s)!\n", error_string);
-        wmem_free(NULL, error_string);
+        printf("Expert tap error (%s)!\n", error_string->str);
+        g_string_free(error_string, TRUE);
         g_free(hs);
         exit(1);
     }
index cfce4a9c9cfd002e4de738f06ce9dc463d2876a3..9d2b2d0cc925aad464c6237599cf49ce7a61d6db 100644 (file)
@@ -445,7 +445,7 @@ static void follow_stream(const char *opt_argp, void *userdata)
 {
   follow_info_t *follow_info;
   cli_follow_info_t* cli_follow_info;
-  gchar *errp;
+  GString  *errp;
   register_follow_t* follower = (register_follow_t*)userdata;
   follow_index_filter_func index_filter;
   follow_address_filter_func address_filter;
@@ -488,7 +488,7 @@ static void follow_stream(const char *opt_argp, void *userdata)
   if (errp != NULL)
   {
     follow_free(follow_info);
-    wmem_free(NULL, errp);
+    g_string_free(errp, TRUE);
     follow_exit("Error registering tap listener.");
   }
 }
index 7dc26e3d07864911a789a82ebe2c7bb574101447..8b5bb2b5ab2bc5cc030c386ee5da391205f52bb3 100644 (file)
@@ -320,7 +320,7 @@ static void
 gsm_a_stat_init(const char *opt_arg _U_, void *userdata _U_)
 {
     gsm_a_stat_t        *stat_p;
-    gchar               *err_p;
+    GString             *err_p;
 
     stat_p = g_new(gsm_a_stat_t, 1);
 
@@ -335,7 +335,7 @@ gsm_a_stat_init(const char *opt_arg _U_, void *userdata _U_)
     if (err_p != NULL)
     {
         g_free(stat_p);
-        wmem_free(NULL, err_p);
+        g_string_free(err_p, TRUE);
 
         exit(1);
     }
index 1837738b09dba939f49bfe96b01cd2032619b787..f81a9fc73983f6d1b38d7509ac47d0f26d65d8d6 100644 (file)
@@ -95,7 +95,7 @@ hosts_draw(void *dummy _U_)
 static void
 hosts_init(const char *opt_arg, void *userdata _U_)
 {
-       gchar *error_string;
+       GString *error_string;
        gchar **tokens;
        gint opt_count;
 
@@ -128,8 +128,8 @@ hosts_init(const char *opt_arg, void *userdata _U_)
        if (error_string) {
                /* error, we failed to attach to the tap. clean up */
                fprintf(stderr, "tshark: Couldn't register " TAP_NAME " tap: %s\n",
-                       error_string);
-               wmem_free(NULL, error_string);
+                       error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 }
index ae49a0fce8db8d4022d67abb460002b2855ad0a4..6b7334b223d0ab2caf2b7414e577c7c2b0850076 100644 (file)
@@ -284,7 +284,7 @@ httpstat_init(const char *opt_arg, void *userdata _U_)
 {
        httpstat_t *sp;
        const char *filter = NULL;
-       gchar      *error_string;
+       GString    *error_string;
 
        if (!strncmp (opt_arg, "http,stat,", 10)) {
                filter = opt_arg+10;
@@ -314,8 +314,8 @@ httpstat_init(const char *opt_arg, void *userdata _U_)
                g_free(sp->filter);
                g_free(sp);
                fprintf (stderr, "tshark: Couldn't register http,stat tap: %s\n",
-                        error_string);
-               wmem_free(NULL, error_string);
+                        error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 
index 6db273b0def528708ab5549649343ea685820255..9102cf32feca068e676cb65d18e3729030df453a 100644 (file)
@@ -270,7 +270,7 @@ icmpstat_init(const char *opt_arg, void *userdata _U_)
 {
     icmpstat_t *icmpstat;
     const char *filter = NULL;
-    gchar *error_string;
+    GString *error_string;
 
     if (strstr(opt_arg, "icmp,srt,"))
         filter = opt_arg + strlen("icmp,srt,");
@@ -305,8 +305,8 @@ icmpstat_init(const char *opt_arg, void *userdata _U_)
         g_free(icmpstat);
 
         fprintf(stderr, "tshark: Couldn't register icmp,srt tap: %s\n",
-            error_string);
-        wmem_free(NULL, error_string);
+            error_string->str);
+        g_string_free(error_string, TRUE);
         exit(1);
     }
 }
index 9c5d3726847cdd49562d35fa507468dc271eb495..6c2a59d0d76acdb3cbafec7cd51c0ca001c4e1bb 100644 (file)
@@ -271,7 +271,7 @@ icmpv6stat_init(const char *opt_arg, void *userdata _U_)
 {
     icmpv6stat_t *icmpv6stat;
     const char *filter = NULL;
-    gchar *error_string;
+    GString *error_string;
 
     if (strstr(opt_arg, "icmpv6,srt,"))
         filter = opt_arg + strlen("icmpv6,srt,");
@@ -306,8 +306,8 @@ icmpv6stat_init(const char *opt_arg, void *userdata _U_)
         g_free(icmpv6stat);
 
         fprintf(stderr, "tshark: Couldn't register icmpv6,srt tap: %s\n",
-            error_string);
-        wmem_free(NULL, error_string);
+            error_string->str);
+        g_string_free(error_string, TRUE);
         exit(1);
     }
 }
index 5d3e6ee60149ac738a8a9fb0f2fd2af41b2cea12..d481e1e8987b7c02aed3c9263bb1acde07c18a1a 100644 (file)
@@ -1220,7 +1220,7 @@ iostat_draw(void *arg)
 static void
 register_io_tap(io_stat_t *io, int i, const char *filter)
 {
-    gchar *error_string;
+    GString *error_string;
     const char *flt;
     int j;
     size_t namelen;
@@ -1372,8 +1372,8 @@ register_io_tap(io_stat_t *io, int i, const char *filter)
         g_free(io->items);
         g_free(io);
         fprintf(stderr, "\ntshark: Couldn't register io,stat tap: %s\n",
-            error_string);
-        wmem_free(NULL, error_string);
+            error_string->str);
+        g_string_free(error_string, TRUE);
         exit(1);
     }
 }
index fb7e0d2f466d19242ab3193357d91e84543f23e0..06f02697ac6c03554bd59a86c5a02a0ce6216616 100644 (file)
@@ -215,7 +215,7 @@ iousers_draw(void *arg)
 void init_iousers(struct register_ct *ct, const char *filter)
 {
        io_users_t *iu;
-       gchar *error_string;
+       GString *error_string;
 
        iu = g_new0(io_users_t, 1);
        iu->type = proto_get_protocol_short_name(find_protocol_by_id(get_conversation_proto_id(ct)));
@@ -226,8 +226,8 @@ void init_iousers(struct register_ct *ct, const char *filter)
        if (error_string) {
                g_free(iu);
                fprintf(stderr, "tshark: Couldn't register conversations tap: %s\n",
-                   error_string);
-               wmem_free(NULL, error_string);
+                   error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 
index d5afbdd4eb3d79c3783ff4b082ce2c12652da301..c50dab9a87057be9bdb6dedad74f6ddaa73f5e8a 100644 (file)
@@ -517,7 +517,7 @@ static void mac_lte_stat_init(const char *opt_arg, void *userdata _U_)
 {
     mac_lte_stat_t    *hs;
     const char    *filter = NULL;
-    gchar         *error_string;
+    GString       *error_string;
 
     /* Check for a filter string */
     if (strncmp(opt_arg, "mac-lte,stat,", 13) == 0) {
@@ -539,7 +539,7 @@ static void mac_lte_stat_init(const char *opt_arg, void *userdata _U_)
                                          mac_lte_stat_packet,
                                          mac_lte_stat_draw);
     if (error_string) {
-        wmem_free(NULL, error_string);
+        g_string_free(error_string, TRUE);
         g_free(hs);
         exit(1);
     }
index 8be62703eebf92458425796644d410eb75ed174e..23581bc127564b48e8fc77f883867bfb68582f11 100644 (file)
@@ -87,7 +87,7 @@ protocolinfo_init(const char *opt_arg, void *userdata _U_)
        const char *field = NULL;
        const char *filter = NULL;
        header_field_info *hfi;
-       gchar *error_string;
+       GString *error_string;
 
        if (!strncmp("proto,colinfo,", opt_arg, 14)) {
                filter = opt_arg+14;
@@ -120,8 +120,8 @@ protocolinfo_init(const char *opt_arg, void *userdata _U_)
        if (error_string) {
                /* error, we failed to attach to the tap. complain and clean up */
                fprintf(stderr, "tshark: Couldn't register proto,colinfo tap: %s\n",
-                   error_string);
-               wmem_free(NULL, error_string);
+                   error_string->str);
+               g_string_free(error_string, TRUE);
                g_free(rs->filter);
                g_free(rs);
 
index 24d8365c463685ab15dcdd392839ad09c8fd19d3..6fe4096a699bf75429ded968b875aa5445e30ee1 100644 (file)
@@ -170,7 +170,7 @@ protohierstat_init(const char *opt_arg, void *userdata _U_)
        phs_t *rs;
        int pos = 0;
        const char *filter = NULL;
-       gchar *error_string;
+       GString *error_string;
 
        if (strcmp("io,phs", opt_arg) == 0) {
                /* No arguments */
@@ -198,8 +198,8 @@ protohierstat_init(const char *opt_arg, void *userdata _U_)
                g_free(rs);
 
                fprintf(stderr, "tshark: Couldn't register io,phs tap: %s\n",
-                       error_string);
-               wmem_free(NULL, error_string);
+                       error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 }
index 1cbe48eb4e2c33b5c53cb7543bc9d3b1bf4aade4..546d2a246a36cfcc0bd2561314a8adc663652d26 100644 (file)
@@ -365,7 +365,7 @@ static void rlc_lte_stat_init(const char *opt_arg, void *userdata _U_)
 {
     rlc_lte_stat_t    *hs;
     const char        *filter = NULL;
-    gchar             *error_string;
+    GString           *error_string;
 
     /* Check for a filter string */
     if (strncmp(opt_arg, "rlc-lte,stat,", 13) == 0) {
@@ -392,7 +392,7 @@ static void rlc_lte_stat_init(const char *opt_arg, void *userdata _U_)
                                          rlc_lte_stat_packet,
                                          rlc_lte_stat_draw);
     if (error_string) {
-        wmem_free(NULL, error_string);
+        g_string_free(error_string, TRUE);
         g_free(hs);
         exit(1);
     }
index ee2c9e7b776dcb26925014da7342f84361f6e78f..798062087da9517398c2887a489f67aaf3cd9719 100644 (file)
@@ -211,7 +211,7 @@ rpcprogs_draw(void *dummy _U_)
 static void
 rpcprogs_init(const char *opt_arg _U_, void *userdata _U_)
 {
-       gchar *error_string;
+       GString *error_string;
 
        if (already_enabled) {
                return;
@@ -221,8 +221,8 @@ rpcprogs_init(const char *opt_arg _U_, void *userdata _U_)
        error_string = register_tap_listener("rpc", NULL, NULL, 0, NULL, rpcprogs_packet, rpcprogs_draw);
        if (error_string) {
                fprintf(stderr, "tshark: Couldn't register rpc,programs tap: %s\n",
-                       error_string);
-               wmem_free(NULL, error_string);
+                       error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 }
index c37d02713ae830b3041216ad8ebe7b9a40a75645..2e43286b62b6eb93edea935ccd61d97dc2cf423d 100644 (file)
@@ -102,7 +102,7 @@ rtd_draw(void *arg)
 static void
 init_rtd_tables(register_rtd_t* rtd, const char *filter)
 {
-       gchar *error_string;
+       GString *error_string;
        rtd_t* ui;
 
        ui = g_new0(rtd_t, 1);
@@ -116,8 +116,8 @@ init_rtd_tables(register_rtd_t* rtd, const char *filter)
        error_string = register_tap_listener(get_rtd_tap_listener_name(rtd), &ui->rtd, filter, 0, NULL, get_rtd_packet_func(rtd), rtd_draw);
        if (error_string) {
                free_rtd_table(&ui->rtd.stat_table, NULL, NULL);
-               fprintf(stderr, "tshark: Couldn't register srt tap: %s\n", error_string);
-               wmem_free(NULL, error_string);
+               fprintf(stderr, "tshark: Couldn't register srt tap: %s\n", error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 }
index 230f3560870c69e5fffa6c0548908993ef11bca4..71243474dea881ac02b21b28825f86372a99376a 100644 (file)
@@ -139,7 +139,7 @@ rtp_streams_stat_draw(void *arg _U_)
 static void
 rtp_streams_stat_init(const char *opt_arg _U_, void *userdata _U_)
 {
-    gchar             *err_p;
+    GString             *err_p;
 
     err_p =
         register_tap_listener("rtp", &the_tapinfo_struct, NULL, 0,
@@ -149,7 +149,7 @@ rtp_streams_stat_init(const char *opt_arg _U_, void *userdata _U_)
 
     if (err_p != NULL)
     {
-        wmem_free(NULL, err_p);
+        g_string_free(err_p, TRUE);
 
         exit(1);
     }
index d91167a30d6c6a26df6a22d555ffcc6c95596b76..20d15e46401ebb02f54261dd2ac86ec6841f7586 100644 (file)
@@ -236,7 +236,7 @@ rtspstat_init(const char *opt_arg, void *userdata _U_)
 {
        rtspstat_t *sp;
        const char *filter = NULL;
-       gchar   *error_string;
+       GString *error_string;
 
        if (!strncmp (opt_arg, "rtsp,stat,", 10)) {
                filter = opt_arg+10;
@@ -266,8 +266,8 @@ rtspstat_init(const char *opt_arg, void *userdata _U_)
                g_free(sp->filter);
                g_free(sp);
                fprintf (stderr, "tshark: Couldn't register rtsp,stat tap: %s\n",
-                               error_string);
-               wmem_free(NULL, error_string);
+                               error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 
index cb8efdc42b77c59aef12c25d3a097607bafd2d1c..2d41d362ae129d12e8bef2d500042cedc6544534 100644 (file)
@@ -198,7 +198,7 @@ static void
 sctpstat_init(const char *opt_arg, void *userdata _U_)
 {
        sctpstat_t *hs;
-       gchar      *error_string;
+       GString    *error_string;
 
        hs = (sctpstat_t *)g_malloc(sizeof(sctpstat_t));
        if (!strncmp(opt_arg, "sctp,stat,", 11)) {
@@ -218,8 +218,8 @@ sctpstat_init(const char *opt_arg, void *userdata _U_)
                g_free(hs);
 
                fprintf(stderr, "tshark: Couldn't register sctp,stat tap: %s\n",
-                       error_string);
-               wmem_free(NULL, error_string);
+                       error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 }
index d722ba2f0fcaa5f57aa701100d31eba21bda2e5d..9f52eb458daa4fa8d16617c167cb306ce32c6cab 100644 (file)
@@ -103,7 +103,7 @@ simple_draw(void *arg)
 static void
 init_stat_table(stat_tap_table_ui *new_stat_tap, const char *filter)
 {
-       gchar *error_string;
+       GString *error_string;
        table_stat_t* ui;
 
        ui = g_new0(table_stat_t, 1);
@@ -116,8 +116,8 @@ init_stat_table(stat_tap_table_ui *new_stat_tap, const char *filter)
        error_string = register_tap_listener(new_stat_tap->tap_name, &ui->stats, filter, 0, NULL, new_stat_tap->packet_func, simple_draw);
        if (error_string) {
 /*             free_rtd_table(&ui->rtd.stat_table, NULL, NULL); */
-               fprintf(stderr, "tshark: Couldn't register tap: %s\n", error_string);
-               wmem_free(NULL, error_string);
+               fprintf(stderr, "tshark: Couldn't register tap: %s\n", error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 }
index bac6b0f4f54581a78db4a455353bb5300ba91633..a7936102dbb7cb0000f9cf0be686f69e85e65bcf 100644 (file)
@@ -394,7 +394,7 @@ sipstat_init(const char *opt_arg, void *userdata _U_)
 {
        sipstat_t  *sp;
        const char *filter = NULL;
-       gchar      *error_string;
+       GString    *error_string;
 
        if (strncmp (opt_arg, "sip,stat,", 9) == 0) {
                filter = opt_arg+9;
@@ -424,8 +424,8 @@ sipstat_init(const char *opt_arg, void *userdata _U_)
                g_free(sp->filter);
                g_free(sp);
                fprintf (stderr, "tshark: Couldn't register sip,stat tap: %s\n",
-                        error_string);
-               wmem_free(NULL, error_string);
+                        error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 
index ce6f3f6be9635ca8d9ce83c9979759f0f1450216..0234281e2820aec4092e8e7fa7e6426e4db2d754 100644 (file)
@@ -66,7 +66,7 @@ smbsids_draw(void *pss _U_)
 static void
 smbsids_init(const char *opt_arg _U_, void *userdata _U_)
 {
-       gchar *error_string;
+       GString *error_string;
 
        if (!sid_name_snooping) {
                fprintf(stderr, "The -z smb,sids function needs SMB/SID-Snooping to be enabled.\n");
@@ -81,8 +81,8 @@ smbsids_init(const char *opt_arg _U_, void *userdata _U_)
        error_string = register_tap_listener("smb", NULL, NULL, 0, NULL, smbsids_packet, smbsids_draw);
        if (error_string) {
                fprintf(stderr, "tshark: Couldn't register smb,sids tap:%s\n",
-                       error_string);
-               wmem_free(NULL, error_string);
+                       error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 }
index d6a965e484533149fea37cb1066934ef126f52ef..32fde53594c74cd3683b3745f952d51d8b699cbd 100644 (file)
@@ -118,7 +118,7 @@ static void
 init_srt_tables(register_srt_t* srt, const char *filter)
 {
        srt_t *ui;
-       gchar *error_string;
+       GString *error_string;
 
        ui = g_new0(srt_t, 1);
        ui->type = proto_get_protocol_short_name(find_protocol_by_id(get_srt_proto_id(srt)));
@@ -130,8 +130,8 @@ init_srt_tables(register_srt_t* srt, const char *filter)
        if (error_string) {
                free_srt_table(srt, global_srt_array, NULL, NULL);
                g_free(ui);
-               fprintf(stderr, "tshark: Couldn't register srt tap: %s\n", error_string);
-               wmem_free(NULL, error_string);
+               fprintf(stderr, "tshark: Couldn't register srt tap: %s\n", error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 }
index fedf22da3b1ea4b88ae5a2340c18e4f2199ea845..f30a5dc23b8dd8acfcbb3022ff91f5f436974df9 100644 (file)
@@ -64,7 +64,7 @@ static void
 init_stats_tree(const char *opt_arg, void *userdata _U_)
 {
        char *abbr = stats_tree_get_abbr(opt_arg);
-       gchar *error_string;
+       GString *error_string;
        stats_tree_cfg *cfg = NULL;
        stats_tree *st = NULL;
 
@@ -99,8 +99,7 @@ init_stats_tree(const char *opt_arg, void *userdata _U_)
                                             draw_stats_tree);
 
        if (error_string) {
-               report_failure("stats_tree for: %s failed to attach to the tap: %s", cfg->name, error_string);
-               wmem_free(NULL, error_string);
+               report_failure("stats_tree for: %s failed to attach to the tap: %s", cfg->name, error_string->str);
                return;
        }
 
index 731fe42a67a038271ac9fda065a960ec7b3b7d45..c7a43ef294bcc2dd0469dce00f680f6323192371 100644 (file)
@@ -56,7 +56,7 @@ sv_packet(void *prs _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void
 static void
 svstat_init(const char *opt_arg _U_, void *userdata _U_)
 {
-       gchar   *error_string;
+       GString *error_string;
 
        error_string = register_tap_listener(
                "sv",
@@ -69,8 +69,8 @@ svstat_init(const char *opt_arg _U_, void *userdata _U_)
        if (error_string) {
                /* error, we failed to attach to the tap. clean up */
                fprintf(stderr, "tshark: Couldn't register sv,stat tap: %s\n",
-                               error_string);
-               wmem_free(NULL, error_string);
+                               error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 }
index f65280bbbeb0f1867de9bdf986b23bde3b34f6cd..b2a0ba46a87cdd938819576ff0fdc25623926d6a 100644 (file)
@@ -216,7 +216,7 @@ wspstat_init(const char *opt_arg, void *userdata _U_)
        wspstat_t          *sp;
        const char         *filter = NULL;
        guint32             i;
-       gchar              *error_string;
+       GString            *error_string;
        wsp_status_code_t  *sc;
        const value_string *wsp_vals_status_p;
 
@@ -272,8 +272,8 @@ wspstat_init(const char *opt_arg, void *userdata _U_)
                g_hash_table_foreach( sp->hash, (GHFunc) wsp_free_hash_table, NULL ) ;
                g_hash_table_destroy( sp->hash );
                fprintf(stderr, "tshark: Couldn't register wsp,stat tap: %s\n",
-                               error_string);
-               wmem_free(NULL, error_string);
+                               error_string->str);
+               g_string_free(error_string, TRUE);
                exit(1);
        }
 }
index fe2c5e634a816f2eb510b8de61918bc0fa9babd1..7239d5bace469368ac953d489b3bd236b4c3f596 100644 (file)
@@ -699,7 +699,7 @@ gtk_comparestat_init(const char *opt_arg, void* userdata _U_)
        gdouble variance;
        gint start, stop,ttl, order, pos=0;
        const char *filter=NULL;
-       gchar *error_string;
+       GString *error_string;
 
        if(sscanf(opt_arg,"compare,%d,%d,%d,%d,%lf%n",&start, &stop, &ttl, &order, &variance, &pos)==5){
                if(*(opt_arg+pos)==',')
@@ -791,8 +791,8 @@ gtk_comparestat_init(const char *opt_arg, void* userdata _U_)
 
        error_string=register_tap_listener("ip", cs, filter, 0, comparestat_reset, comparestat_packet, comparestat_draw);
        if(error_string){
-               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-               wmem_free(NULL, error_string);
+               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+               g_string_free(error_string, TRUE);
                gtk_tree_store_clear(cs->simple_list);
                g_hash_table_destroy(cs->packet_set);
                g_hash_table_destroy(cs->ip_id_set);
index 4927220aa530d0941d63cfb790315ea87f0316d0..7fc02e2eb031099e4f469564f44d1d5b60d810fb 100644 (file)
@@ -70,7 +70,7 @@ reset_ct_table_data(conversations_table *ct)
 {
     char *display_name;
     char title[256];
-    gchar *error_string;
+    GString *error_string;
     const char *filter;
     GtkListStore *store;
 
@@ -82,8 +82,8 @@ reset_ct_table_data(conversations_table *ct)
 
     error_string = set_tap_dfilter (&ct->hash, filter);
     if (error_string) {
-        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-        wmem_free(NULL, error_string);
+        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+        g_string_free(error_string, TRUE);
         return;
     }
 
@@ -1925,7 +1925,7 @@ init_ct_table_page(conversations_table *conversations, GtkWidget *vbox, gboolean
     tap_packet_cb packet_func)
 {
     int i;
-    gchar *error_string;
+    GString *error_string;
     char title[256];
 
     GtkListStore *store;
@@ -2059,8 +2059,8 @@ init_ct_table_page(conversations_table *conversations, GtkWidget *vbox, gboolean
     error_string=register_tap_listener(tap_name, &conversations->hash, filter, 0, reset_ct_table_data_cb, packet_func,
         draw_ct_table_data_cb);
     if(error_string){
-        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-        wmem_free(NULL, error_string);
+        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+        g_string_free(error_string, TRUE);
         return FALSE;
     }
 
index a846f9c609c792ee27fd7def153cb3d1b8c64f4f..e9186fdda7c33e3da7698676ef4f02ea9b096b85 100644 (file)
@@ -146,7 +146,7 @@ gtk_dcerpcstat_init(const char *opt_arg, void* userdata _U_)
        int pos = 0;
        const char *filter = NULL;
        dcerpcstat_tap_data_t* tap_data;
-       gchar *error_string;
+       GString *error_string;
 
        /*
         * XXX - DCE RPC statistics are maintained only by major version,
@@ -260,8 +260,8 @@ gtk_dcerpcstat_init(const char *opt_arg, void* userdata _U_)
        error_string = register_tap_listener("dcerpc", &rs->data, filter, 0, dcerpcstat_reset, get_srt_packet_func(rs->srt), dcerpcstat_draw);
        if(error_string){
                /* error, we failed to attach to the tap. clean up */
-               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-               wmem_free(NULL, error_string);
+               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+               g_string_free(error_string, TRUE);
                free_srt_table(rs->srt, rs->data.srt_array, NULL, NULL);
                g_free(rs);
                return;
index 8087b47dda56fac7aaf1473ed965e65aacdf9e33..9450bbbbae7a1191fb08cd62f4584debfdbff811 100644 (file)
@@ -143,7 +143,7 @@ expert_comp_select_filter_cb(GtkWidget *widget, gpointer callback_data, guint ca
 {
     expert_comp_dlg_t *ss = (expert_comp_dlg_t *)callback_data;
     const char *filter;
-    gchar *error_string;
+    GString *error_string;
 
     ss->use_dfilter = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget));
     if (ss->use_dfilter) {
@@ -153,14 +153,14 @@ expert_comp_select_filter_cb(GtkWidget *widget, gpointer callback_data, guint ca
     }
     error_string = set_tap_dfilter (ss, filter);
     if (error_string) {
-        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-        wmem_free(NULL, error_string);
+        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+        g_string_free(error_string, TRUE);
         return;
     }
     error_string = set_tap_dfilter (ss->etd, filter);
     if (error_string) {
-        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-        wmem_free(NULL, error_string);
+        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+        g_string_free(error_string, TRUE);
         return;
     }
 
@@ -791,7 +791,7 @@ static void
 expert_comp_init(const char *opt_arg _U_, void* userdata _U_)
 {
     expert_comp_dlg_t *ss;
-    gchar *error_string;
+    GString *error_string;
     GtkWidget *temp_page, *details_page, *comments_page;
     GtkWidget *main_nb;
     GtkWidget *vbox;
@@ -950,8 +950,8 @@ expert_comp_init(const char *opt_arg _U_, void* userdata _U_)
                                        expert_dlg_packet,
                                        expert_dlg_draw);
     if(error_string){
-        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-        wmem_free(NULL, error_string);
+        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+        g_string_free(error_string, TRUE);
         g_free(ss->etd);
         return;
     }
@@ -964,8 +964,8 @@ expert_comp_init(const char *opt_arg _U_, void* userdata _U_)
     error_string=register_tap_listener("expert", ss, NULL,
         TL_REQUIRES_NOTHING, error_reset, error_packet, expert_comp_draw);
     if(error_string){
-        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-        wmem_free(NULL, error_string);
+        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+        g_string_free(error_string, TRUE);
         g_free(ss);
         return;
     }
index 423348063261b4c060268284bf9a14fbd6e9ebda..ee1c3af8b3602d1d6de61638e1831263c51f31ec 100644 (file)
@@ -322,7 +322,7 @@ export_object_window(const gchar *tapname, const gchar *name, tap_packet_cb tap_
        GtkTreeViewColumn *column;
        GtkTreeSelection *selection;
        GtkWidget *vbox, *bbox, *help_bt, *cancel_bt, *save_bt, *save_all_bt;
-       gchar *error_msg;
+       GString *error_msg;
        export_object_list_t *object_list;
        gchar *window_title;
 
@@ -340,8 +340,8 @@ export_object_window(const gchar *tapname, const gchar *name, tap_packet_cb tap_
 
        if (error_msg) {
                simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                             "Can't register %s tap: %s\n", name, error_msg);
-               wmem_free(NULL, error_msg);
+                             "Can't register %s tap: %s\n", name, error_msg->str);
+               g_string_free(error_msg, TRUE);
                g_free(object_list);
                return;
        }
index ad1e6b8d269c3aca0909959c941e45a609745f73..d12a6234c006732ef963426f208b1e11c3119cf1 100644 (file)
@@ -170,7 +170,7 @@ static void follow_stream_cb(register_follow_t* follower, follow_read_stream_fun
     gchar       *both_directions_string = NULL;
     follow_info_t  *follow_info;
     gtk_follow_info_t *gtk_follow_info;
-    gchar *msg;
+    GString *msg;
     gboolean is_follow = FALSE;
     guint32 ignore_stream;
     char  stream_window_title[256];
@@ -232,12 +232,11 @@ static void follow_stream_cb(register_follow_t* follower, follow_read_stream_fun
     if (msg) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
                       "Can't register %s tap: %s\n",
-                      get_follow_tap_string(follower), msg);
+                      get_follow_tap_string(follower), msg->str);
         g_free(gtk_follow_info);
         g_free(follow_info->filter_out_filter);
         g_free(follow_info);
         g_free(follow_filter);
-        wmem_free(NULL, msg);
         return;
     }
 
index 1f261c0fcf86c63e53af6e6f6b95f4f5d1851054..15fd6b96449030e792a18b22b8a1a3738da5c4bf 100644 (file)
@@ -396,7 +396,7 @@ gsm_map_summary_packet(
 void
 register_tap_listener_gtk_gsm_map_summary(void)
 {
-    gchar     *err_p;
+    GString     *err_p;
 
     memset((void *) &gsm_map_stat, 0, sizeof(gsm_map_stat_t));
 
@@ -408,8 +408,8 @@ register_tap_listener_gtk_gsm_map_summary(void)
 
     if (err_p != NULL)
     {
-        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_p);
-        wmem_free(NULL, err_p);
+        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_p->str);
+        g_string_free(err_p, TRUE);
 
         exit(1);
     }
index 1f72114a68b293ceed914ea36926fd7dcc38cb9d..e65f2273929d388e44b17707061b6250b36962a5 100644 (file)
@@ -75,7 +75,7 @@ reset_host_table_data(hostlist_table *hosts)
 {
     char *display_name;
     char title[256];
-    gchar *error_string;
+    GString *error_string;
     const char *filter;
     GtkListStore *store;
 
@@ -86,8 +86,8 @@ reset_host_table_data(hostlist_table *hosts)
     }
     error_string = set_tap_dfilter (&hosts->hash, filter);
     if (error_string) {
-        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-        wmem_free(NULL, error_string);
+        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+        g_string_free(error_string, TRUE);
         return;
     }
 
@@ -850,7 +850,7 @@ init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hi
   const char *filter, tap_packet_cb packet_func)
 {
     guint i;
-    gchar *error_string;
+    GString *error_string;
     char title[256];
     GtkListStore *store;
     GtkWidget *tree;
@@ -1009,8 +1009,8 @@ init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hi
     /* register the tap and rerun the taps on the packet list */
     error_string=register_tap_listener(tap_name, &hosttable->hash, filter, 0, reset_hostlist_table_data_cb, packet_func, draw_hostlist_table_data_cb);
     if(error_string){
-        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-        wmem_free(NULL, error_string);
+        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+        g_string_free(error_string, TRUE);
         g_free(hosttable);
         return FALSE;
     }
index 1cf3b256eabbabc607328959212efa433c30dc21..604f721ba37d3721d5c665d25695df6df7a52a14 100644 (file)
@@ -1864,7 +1864,7 @@ static void
 on_refresh_bt_clicked(GtkWidget *bt _U_, gpointer data)
 {
        user_data_t *user_data = (user_data_t *)data;
-       gchar       *error_string;
+       GString     *error_string;
 
        /* remove tap listener */
        remove_tap_listener(user_data);
@@ -1873,8 +1873,8 @@ on_refresh_bt_clicked(GtkWidget *bt _U_, gpointer data)
        error_string = register_tap_listener("IAX2", user_data, NULL, 0,
                iax2_reset, iax2_packet, iax2_draw);
        if (error_string != NULL) {
-               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-                       wmem_free(NULL, error_string);
+               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+                       g_string_free(error_string, TRUE);
                return;
        }
 
index 6853d2116b5f45bb947d040e3082400032b89226..b077429d5692a574af873f64d8adfe8a8d6fc813 100644 (file)
@@ -1068,11 +1068,11 @@ tap_iostat_draw(void *g)
    be able to pick up the field values after the edt tree has been
    pruned
 */
-static gchar *
+static GString *
 enable_graph(io_stat_graph_t *gio, const char *filter, const char *field)
 {
     GString *real_filter = NULL;
-    gchar *err_msg;
+    GString *err_msg;
 
     gio->display = TRUE;
 
@@ -1155,7 +1155,7 @@ iostat_init(const char *opt_arg _U_, void* userdata _U_)
         {1.0, 0.314, 1.0,   1.0}  /* Light brilliant magenta */
     };
 
-    gchar *error_string;
+    GString *error_string;
 
     io = g_new(io_stat_t,1);
     io->needs_redraw         = TRUE;
index df99266756d09a8f2f08f262e51eb8015b52d7be..d3fea45ce15bdc19175445b62294a9e5d4b932c3 100644 (file)
@@ -738,7 +738,7 @@ static void lbmc_stream_dlg_tap_draw(void * tap_data _U_)
 /**************************************************************/
 void lbmc_stream_dlg_stream_menu_cb(gpointer arg _U_)
 {
-    gchar * err_msg;
+    GString * err_msg;
 
     if (global_stream_dialog_info != NULL)
     {
@@ -755,8 +755,8 @@ void lbmc_stream_dlg_stream_menu_cb(gpointer arg _U_)
         lbmc_stream_dlg_tap_draw);
     if (err_msg != NULL)
     {
-        fprintf(stderr, "register_tap_listener: %s\n", err_msg);
-        wmem_free(NULL, err_msg);
+        fprintf(stderr, "register_tap_listener: %s\n", err_msg->str);
+        g_string_free(err_msg, TRUE);
     }
     cf_retap_packets(&cfile);
 }
index 5ed9e3b62565b924a859a245943c7a9071c9a9c3..b0993547b69b13bf43ac73da26cb76004ff73203 100644 (file)
@@ -241,7 +241,7 @@ static void lbmc_uim_flow_graph_on_ok_cb(GtkButton * button _U_, gpointer user_d
     /* Scan for displayed packets (retap all packets) */
     if (dialog_data.have_tap_listener == FALSE)
     {
-        gchar * err_msg;
+        GString * err_msg;
 
         err_msg = register_tap_listener("lbm_uim",
             &(dialog_data.tap_identifier),
@@ -252,8 +252,8 @@ static void lbmc_uim_flow_graph_on_ok_cb(GtkButton * button _U_, gpointer user_d
             lbmc_uim_flow_tap_draw);
         if (err_msg != NULL)
         {
-            fprintf(stderr, "register_tap_listener: %s\n", err_msg);
-            wmem_free(NULL, err_msg);
+            fprintf(stderr, "register_tap_listener: %s\n", err_msg->str);
+            g_string_free(err_msg, TRUE);
         }
         dialog_data.have_tap_listener = TRUE;
     }
index af2e3b0bcb0d776584f3a97e9173f008322d3e1a..3057e3e8c2ae35b05a277ccb405424a258747622 100644 (file)
@@ -1003,7 +1003,7 @@ static void gtk_mac_lte_stat_init(const char *opt_arg, void *userdata _U_)
 {
     mac_lte_stat_t *hs;
     const char *filter = NULL;
-    gchar    *error_string;
+    GString    *error_string;
     GtkWidget  *ues_scrolled_window;
     GtkWidget  *bbox;
     GtkWidget  *top_level_vbox;
@@ -1366,8 +1366,8 @@ static void gtk_mac_lte_stat_init(const char *opt_arg, void *userdata _U_)
                                          mac_lte_stat_packet,
                                          mac_lte_stat_draw);
     if (error_string) {
-        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-        wmem_free(NULL, error_string);
+        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+        g_string_free(error_string, TRUE);
         g_free(hs);
         return;
     }
index cd390eca85b12ddd1084392210df82345409d36d..bcad63b05b643397061326774efeea5c01a528d0 100644 (file)
@@ -2296,9 +2296,14 @@ main(int argc, char *argv[])
 
 #ifdef HAVE_PLUGINS
     /* Register all the plugin types we have. */
+    epan_register_plugin_types(); /* Types known to libwireshark */
     wtap_register_plugin_types(); /* Types known to libwiretap */
     codec_register_plugin_types(); /* Types known to libwscodecs */
 
+    /* Scan for plugins.  This does *not* call their registration routines;
+       that's done later. */
+    scan_plugins();
+
     /* Register all libwiretap plugin modules. */
     register_all_wiretap_modules();
 
index c45bc48ba5eed7531ef31ad1d81ad4a94c23480d..19177204491816cd8856396d9576da7f8f40b0bc 100644 (file)
@@ -530,7 +530,7 @@ mtp3_summary_packet(
 void
 register_tap_listener_gtk_mtp3_summary(void)
 {
-    gchar     *err_p;
+    GString     *err_p;
 
     memset((void *) &mtp3_stat, 0, sizeof(mtp3_stat));
 
@@ -542,8 +542,8 @@ register_tap_listener_gtk_mtp3_summary(void)
 
     if (err_p != NULL)
     {
-        simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "%s", err_p);
-        wmem_free(NULL, err_p);
+        simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK, "%s", err_p->str);
+        g_string_free(err_p, TRUE);
 
         exit(1);
     }
index fde0258083e1f9f258b059409aaa1961f0a74cdc..fb110fe0181a221e7a15042f1369a5055cac84e5 100644 (file)
@@ -275,7 +275,7 @@ init_rtd_tables(register_rtd_t* rtd, const char *filter)
 {
        rtd_t *rr;
        gchar *str;
-       gchar *error_string;
+       GString *error_string;
        GtkWidget *bbox;
        GtkWidget *close_bt;
 
@@ -304,8 +304,8 @@ init_rtd_tables(register_rtd_t* rtd, const char *filter)
 
        error_string = register_tap_listener(get_rtd_tap_listener_name(rtd), &rr->data, filter, 0, rtd_reset, get_rtd_packet_func(rtd), rtd_draw);
        if(error_string){
-               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-               wmem_free(NULL, error_string);
+               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+               g_string_free(error_string, TRUE);
                free_rtd_table(&rr->data.stat_table, NULL, NULL);
                g_free(rr);
                return;
index 55aced9fa05fa4ac8e2423ce3142f06612133d11..6ff23b3ccdda072ba3a31c8134a4d284372b0640 100644 (file)
@@ -1257,7 +1257,7 @@ static void gtk_rlc_lte_stat_init(const char *opt_arg, void *userdata _U_)
 {
     rlc_lte_stat_t    *hs;
     const char        *filter = NULL;
-    gchar             *error_string;
+    GString           *error_string;
     GtkWidget         *ues_scrolled_window;
     GtkWidget         *channels_scrolled_window;
     GtkWidget         *bbox;
@@ -1615,8 +1615,8 @@ static void gtk_rlc_lte_stat_init(const char *opt_arg, void *userdata _U_)
                                          rlc_lte_stat_packet,
                                          rlc_lte_stat_draw);
     if (error_string) {
-        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-        wmem_free(NULL, error_string);
+        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+        g_string_free(error_string, TRUE);
         g_free(hs);
         return;
     }
index 5b068a4418339fb2710a4a63241945c6278a8e04..cf18aa910e70401b84c636ab7aa264c8def2aca6 100644 (file)
@@ -191,7 +191,7 @@ gtk_rpcstat_init(const char *opt_arg, void* userdata _U_)
        GtkWidget *close_bt;
        int program, version, pos;
        const char *filter=NULL;
-       gchar *error_string;
+       GString *error_string;
        rpcstat_tap_data_t* tap_data;
 
        pos=0;
@@ -263,8 +263,8 @@ gtk_rpcstat_init(const char *opt_arg, void* userdata _U_)
 
        error_string=register_tap_listener("rpc", &rs->data, filter, 0, rpcstat_reset, get_srt_packet_func(rs->srt), rpcstat_draw);
        if(error_string){
-               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-               wmem_free(NULL, error_string);
+               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+               g_string_free(error_string, TRUE);
                free_srt_table(rs->srt, rs->data.srt_array, NULL, NULL);
                g_free(rs);
                return;
index a9cb508007832e102abca1b5efb0f2fd3cef0169..daaa6d38e88d7fe8d0f420dddf805bbffdf6abda 100644 (file)
@@ -2038,7 +2038,7 @@ static void draw_stat(user_data_t *user_data);
 static void
 on_refresh_bt_clicked(GtkWidget *bt _U_, user_data_t *user_data)
 {
-       gchar *error_string;
+       GString *error_string;
 
        /* remove tap listener */
        remove_tap_listener(user_data);
@@ -2047,8 +2047,8 @@ on_refresh_bt_clicked(GtkWidget *bt _U_, user_data_t *user_data)
        error_string = register_tap_listener("rtp", user_data, NULL, 0,
                rtp_reset, rtp_packet, rtp_draw);
        if (error_string != NULL) {
-               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-                       wmem_free(NULL, error_string);
+               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+                       g_string_free(error_string, TRUE);
                return;
        }
 
index cbb516df62c20f2b01fb6d958d52b99891534537..edb5de543d46cfbcd83f112ce04ed61415076ebf 100644 (file)
@@ -263,7 +263,7 @@ static void
 sctpstat_init(const char *opt_arg, void *userdata _U_)
 {
        sctpstat_t *hs;
-       gchar *error_string;
+       GString *error_string;
        GtkWidget *bbox;
        GtkWidget *close_bt;
 
@@ -296,8 +296,8 @@ sctpstat_init(const char *opt_arg, void *userdata _U_)
                                           sctpstat_packet,
                                           sctpstat_draw);
        if(error_string){
-               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-               wmem_free(NULL, error_string);
+               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+               g_string_free(error_string, TRUE);
                g_free(hs->filter);
                g_free(hs);
                return;
index de4692b58abd3edf15395dcb6120dc49696d5da9..c1f615849a8597cc21fae3c9a6d0f1767c457f39 100644 (file)
@@ -699,7 +699,7 @@ init_srt_tables(register_srt_t* srt, const char *filter)
        gchar *str;
        GtkWidget *label;
        char *filter_string, *tmp_filter_string;
-       gchar *error_string;
+       GString *error_string;
        GtkWidget *bbox;
        GtkWidget *close_bt;
 
@@ -762,8 +762,8 @@ init_srt_tables(register_srt_t* srt, const char *filter)
 
        error_string = register_tap_listener(get_srt_tap_listener_name(srt), &ss->data, filter, 0, srt_reset, get_srt_packet_func(srt), srt_draw);
        if(error_string){
-               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-               wmem_free(NULL, error_string);
+               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+               g_string_free(error_string, TRUE);
                free_srt_table(ss->srt, ss->data.srt_array, NULL, NULL);
                g_free(ss);
                return;
index a7d60ecd95e5968b98e7ed0fa1368d4c05411999..669815d91673dba963f355fb91c6de96652fed36 100644 (file)
@@ -196,7 +196,7 @@ static void
 init_simple_stat_tables(stat_tap_table_ui *new_stat_tap, const char *filter)
 {
        simple_stat_t *ss;
-       gchar *error_string;
+       GString *error_string;
        GtkWidget *bbox;
        GtkWidget *close_bt;
 
@@ -221,8 +221,8 @@ init_simple_stat_tables(stat_tap_table_ui *new_stat_tap, const char *filter)
 
        error_string = register_tap_listener(new_stat_tap->tap_name, &ss->data, filter, 0, simple_stat_reset, new_stat_tap->packet_func, simple_stat_draw);
        if(error_string){
-               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-               wmem_free(NULL, error_string);
+               simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+               g_string_free(error_string, TRUE);
                free_stat_tables(ss->new_stat_tap, NULL, NULL);
                g_free(ss);
                return;
index 85e8f977fbccd1c654928300487e0bdfce9eff0e..7979540f7fee3e34f9cd1c067a50efcf0f27be2d 100644 (file)
@@ -399,7 +399,7 @@ init_gtk_tree(const char* opt_arg, void *userdata _U_)
        tree_pres* pr = (tree_pres *)g_malloc(sizeof(tree_pres));
        gchar* title = NULL;
        gchar* window_name = NULL;
-       gchar* error_string;
+       GString* error_string;
        GtkWidget *scr_win;
        size_t init_strlen;
        GtkWidget *main_vb, *bbox, *bt_close, *bt_copy, *bt_saveas;
@@ -510,8 +510,8 @@ init_gtk_tree(const char* opt_arg, void *userdata _U_)
        if (error_string) {
                /* error, we failed to attach to the tap. clean up */
                /* destroy_stat_tree_window(st); */
-               report_failure("stats_tree for: %s failed to attach to the tap: %s",cfg->name,error_string);
-               wmem_free(NULL, error_string);
+               report_failure("stats_tree for: %s failed to attach to the tap: %s",cfg->name,error_string->str);
+               g_string_free(error_string, TRUE);
        }
 
        /* Button row. */
index ec23d36cd4b81f493578257ccb26250fa2f9f013..9cd9b8618163d437fd09153298e5277dc495dd8d 100644 (file)
@@ -158,7 +158,7 @@ wlanstat_reset (void *phs)
     wlan_ep_t    *list      = wlan_stat->ep_list;
     char         *display_name;
     char          title[256];
-    gchar        *error_string;
+    GString      *error_string;
     GtkListStore *store;
     const char   *filter    = NULL;
 
@@ -176,8 +176,8 @@ wlanstat_reset (void *phs)
 
     error_string = set_tap_dfilter (wlan_stat, filter);
     if (error_string) {
-        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-        wmem_free(NULL, error_string);
+        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+        g_string_free(error_string, TRUE);
         return;
     }
 
@@ -1745,7 +1745,7 @@ static void
 wlanstat_dlg_create (void)
 {
     wlanstat_t        *hs;
-    gchar             *error_string;
+    GString           *error_string;
     GtkWidget         *scrolled_window;
     GtkWidget         *bbox;
     GtkWidget         *vbox;
@@ -1918,8 +1918,8 @@ wlanstat_dlg_create (void)
                         wlanstat_reset, wlanstat_packet,
                         wlanstat_draw);
     if (error_string) {
-        simple_dialog (ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-        wmem_free(NULL, error_string);
+        simple_dialog (ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+        g_string_free (error_string, TRUE);
         g_free (hs);
         return;
     }
index 4daca8b7d2cbffef50cfda6898056770d15761f4..badc1fcf3621a30ec17caa758bad7d3d9d4070a1 100644 (file)
@@ -259,7 +259,7 @@ mcaststream_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const
 
     /* increment the packets counter for this stream and calculate average pps */
     ++(strinfo->npackets);
-
+    
     if (deltatime > 0) {
         strinfo->apackets = strinfo->npackets / deltatime;
         strinfo->average_bw = ((double)(strinfo->total_bytes*8) / deltatime);
@@ -332,7 +332,7 @@ remove_tap_listener_mcast_stream(mcaststream_tapinfo_t *tapinfo)
 void
 register_tap_listener_mcast_stream(mcaststream_tapinfo_t *tapinfo)
 {
-    gchar *error_string;
+    GString *error_string;
 
     if (!tapinfo) {
         return;
@@ -345,8 +345,8 @@ register_tap_listener_mcast_stream(mcaststream_tapinfo_t *tapinfo)
 
         if (error_string != NULL) {
             simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                          "%s", error_string);
-            wmem_free(NULL, error_string);
+                          "%s", error_string->str);
+            g_string_free(error_string, TRUE);
             exit(1);
         }
 
index a3a50d99f928057b6122f38321db2040e6ff7214..5c72f2d2a41c2b9b237769f52ff184f938d22d66 100644 (file)
@@ -96,7 +96,7 @@ bluetooth_device_tap_reset(void *tapinfo_ptr)
 static void
 bluetooth_devices_tap(void *data)
 {
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("bluetooth.device", data, NULL,
             0,
@@ -107,8 +107,8 @@ bluetooth_devices_tap(void *data)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        g_free(error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
index 87aad65e67d1b399e6142c157ac3b3f2d347e033..a29d3f8136cfe70822e748fa19db85ebef2b6e4e 100644 (file)
@@ -79,7 +79,7 @@ bluetooth_device_tap_reset(void *tapinfo_ptr)
 static void
 bluetooth_devices_tap(void *data)
 {
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("bluetooth.hci_summary", data, NULL,
             0,
@@ -90,8 +90,8 @@ bluetooth_devices_tap(void *data)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
index 7dfb3101a503686cb150abd7e220cc810f570506..ea19f1f60ffe0c2ce935f7f89cb47acafaff4904 100644 (file)
@@ -312,11 +312,11 @@ void ExpertInfoDialog::retapPackets()
     }
 
     if (ui->limitCheckBox->isChecked()) {
-        gchar *error_string = set_tap_dfilter(this, display_filter_.toUtf8().constData());
+        GString *error_string = set_tap_dfilter(this, display_filter_.toUtf8().constData());
         if (error_string) {
             QMessageBox::warning(this, tr("Endpoint expert failed to set filter"),
-                                 error_string);
-            wmem_free(NULL, error_string);
+                                 error_string->str);
+            g_string_free(error_string, TRUE);
             return;
         }
     }
index 2ad0c5c0c12e020d44db49c768c6f68ee0af298e..3265068e941fe5799c0fbfedd93c915144c466fd 100644 (file)
@@ -371,7 +371,7 @@ gsm_map_summary_packet(void *tapdata, packet_info *, epan_dissect_t *, const voi
 void
 register_tap_listener_qt_gsm_map_summary(void)
 {
-    gchar     *err_p;
+    GString     *err_p;
 
     memset((void *) &gsm_map_stat, 0, sizeof(gsm_map_stat_t));
 
@@ -383,8 +383,8 @@ register_tap_listener_qt_gsm_map_summary(void)
 
     if (err_p != NULL)
     {
-        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_p);
-        wmem_free(NULL, err_p);
+        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_p->str);
+        g_string_free(err_p, TRUE);
 
         exit(1);
     }
index 3b18fffb0d625b05b32a4a5de6f4b2ecd9841814..7270d495727e695bf492c6d23fe73bda3f65adc5 100644 (file)
@@ -1650,7 +1650,7 @@ IOGraph::IOGraph(QCustomPlot *parent) :
     graph_ = parent_->addGraph(parent_->xAxis, parent_->yAxis);
     Q_ASSERT(graph_ != NULL);
 
-    gchar *error_string;
+    GString *error_string;
     error_string = register_tap_listener("frame",
                           this,
                           "",
@@ -1661,7 +1661,7 @@ IOGraph::IOGraph(QCustomPlot *parent) :
     if (error_string) {
 //        QMessageBox::critical(this, tr("%1 failed to register tap listener").arg(name_),
 //                             error_string->str);
-        wmem_free(NULL, error_string);
+        g_string_free(error_string, TRUE);
     }
 
     setFilter(QString());
@@ -1682,7 +1682,6 @@ IOGraph::~IOGraph() {
 void IOGraph::setFilter(const QString &filter)
 {
     GString *error_string;
-    gchar* filter_error_string;
     QString full_filter(filter.trimmed());
 
     config_err_.clear();
@@ -1720,10 +1719,10 @@ void IOGraph::setFilter(const QString &filter)
         }
     }
 
-    filter_error_string = set_tap_dfilter(this, full_filter.toUtf8().constData());
-    if (filter_error_string) {
-        config_err_ = filter_error_string;
-        wmem_free(NULL, filter_error_string);
+    error_string = set_tap_dfilter(this, full_filter.toUtf8().constData());
+    if (error_string) {
+        config_err_ = error_string->str;
+        g_string_free(error_string, TRUE);
         return;
     } else {
         if (filter_.compare(filter) && visible_) {
index 87a8b03b08e8878972e213a6c440ac60046a99b2..b232f927ed0fd66a8132553ecda7a933a452c9bd 100644 (file)
@@ -1295,7 +1295,7 @@ void LBMLBTRMTransportDialog::resetReceiversDetail(void)
 
 void LBMLBTRMTransportDialog::fillTree(void)
 {
-    gchar * error_string;
+    GString * error_string;
 
     if (m_capture_file == NULL)
     {
@@ -1313,8 +1313,8 @@ void LBMLBTRMTransportDialog::fillTree(void)
     if (error_string)
     {
         QMessageBox::critical(this, tr("LBT-RM Statistics failed to attach to tap"),
-            error_string);
-        wmem_free(NULL, error_string);
+            error_string->str);
+        g_string_free(error_string, TRUE);
         reject();
     }
 
index 65982b2d732ee9ac805c7dda7c56cf13982543d7..a787b12808948710115752d05025a3836d6f8437 100644 (file)
@@ -1715,7 +1715,7 @@ void LBMLBTRUTransportDialog::resetReceiversDetail(void)
 
 void LBMLBTRUTransportDialog::fillTree(void)
 {
-    gchar * error_string;
+    GString * error_string;
 
     if (m_capture_file == NULL)
     {
@@ -1733,8 +1733,8 @@ void LBMLBTRUTransportDialog::fillTree(void)
     if (error_string)
     {
         QMessageBox::critical(this, tr("LBT-RU Statistics failed to attach to tap"),
-            error_string);
-        wmem_free(NULL, error_string);
+            error_string->str);
+        g_string_free(error_string, TRUE);
         reject();
     }
 
index 1aa90d8b90b6ff8aebed913ddec7c28581d0bb5a..000527a679056a1c071f302b558f16dc5e907229 100644 (file)
@@ -372,7 +372,7 @@ void LBMStreamDialog::setCaptureFile(capture_file * cfile)
 
 void LBMStreamDialog::fillTree(void)
 {
-    gchar * error_string;
+    GString * error_string;
 
     if (m_capture_file == NULL)
     {
@@ -390,8 +390,8 @@ void LBMStreamDialog::fillTree(void)
     if (error_string)
     {
         QMessageBox::critical(this, tr("LBM Stream failed to attach to tap"),
-            error_string);
-        wmem_free(NULL, error_string);
+            error_string->str);
+        g_string_free(error_string, TRUE);
         reject();
     }
 
index 26112384697c396db56f40877ea57589c791000e..f009f939e9407898519aaf2ba19d339d7fdd4d0a 100644 (file)
@@ -371,7 +371,7 @@ mtp3_summary_packet(
 void
 register_tap_listener_qt_mtp3_summary(void)
 {
-    gchar     *err_p;
+    GString     *err_p;
 
     memset((void *) &mtp3_stat, 0, sizeof(mtp3_stat));
 
@@ -383,8 +383,8 @@ register_tap_listener_qt_mtp3_summary(void)
 
     if (err_p != NULL)
     {
-        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_p);
-        wmem_free(NULL, err_p);
+        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", err_p->str);
+        g_string_free(err_p, TRUE);
 
         exit(1);
     }
index 37066f8e0a3b48df11689c8dfbee9906a237e20e..ba5cd12bb185d80b72df2a3f1236798acc6c50cd 100644 (file)
@@ -116,12 +116,12 @@ void WiresharkDialog::updateWidgets()
 
 bool WiresharkDialog::registerTapListener(const char *tap_name, void *tap_data, const char *filter, guint flags, void(*tap_reset)(void *), gboolean(*tap_packet)(void *, struct _packet_info *, struct epan_dissect *, const void *), void(*tap_draw)(void *))
 {
-    gchar *error_string = register_tap_listener(tap_name, tap_data, filter, flags,
+    GString *error_string = register_tap_listener(tap_name, tap_data, filter, flags,
                                                   tap_reset, tap_packet, tap_draw);
     if (error_string) {
         QMessageBox::warning(this, tr("Failed to attach to tap \"%1\"").arg(tap_name),
-                             error_string);
-        wmem_free(NULL, error_string);
+                             error_string->str);
+        g_string_free(error_string, TRUE);
         return false;
     }
 
index afaf678a25bcbca5224ec62b557fd0314281e7b5..01b6198345992f27d06e83116be842bc9e5127d2 100644 (file)
@@ -193,7 +193,7 @@ remove_tap_listener_rtp_stream(rtpstream_tapinfo_t *tapinfo)
 void
 register_tap_listener_rtp_stream(rtpstream_tapinfo_t *tapinfo, const char *fstring)
 {
-    gchar *error_string;
+    GString *error_string;
 
     if (!tapinfo) {
         return;
@@ -206,8 +206,8 @@ register_tap_listener_rtp_stream(rtpstream_tapinfo_t *tapinfo, const char *fstri
 
         if (error_string != NULL) {
             simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                          "%s", error_string);
-            wmem_free(NULL, error_string);
+                          "%s", error_string->str);
+            g_string_free(error_string, TRUE);
             exit(1);
         }
 
index 38980f991a3eeee5606c6c1e306a317a151a8f14..e5bb6cfeb5f5b9168ffa5e78befe51f9442554bf 100644 (file)
@@ -114,7 +114,7 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf,
     epan_dissect_t  edt;
     dfilter_t      *sfcode;
 
-    gchar          *error_string;
+    GString        *error_string;
     nstime_t        rel_ts;
     /* Initialised to no known channels */
     th_t            th = {0, {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}};
@@ -139,8 +139,8 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf,
     error_string = register_tap_listener("rlc-lte", &th, NULL, 0, NULL, tap_lte_rlc_packet, NULL);
     if (error_string){
         fprintf(stderr, "wireshark: Couldn't register rlc_lte_graph tap: %s\n",
-                error_string);
-        wmem_free(NULL, error_string);
+                error_string->str);
+        g_string_free(error_string, TRUE);
         exit(1);   /* XXX: fix this */
     }
 
@@ -250,7 +250,7 @@ gboolean rlc_graph_segment_list_get(capture_file *cf, struct rlc_graph *g, gbool
                                     char **err_string)
 {
     struct rlc_segment current;
-    gchar    *error_string;
+    GString    *error_string;
 
     g_log(NULL, G_LOG_LEVEL_DEBUG, "graph_segment_list_get()");
 
@@ -283,8 +283,8 @@ gboolean rlc_graph_segment_list_get(capture_file *cf, struct rlc_graph *g, gbool
     error_string = register_tap_listener("rlc-lte", g, "rlc-lte", 0, NULL, rlc_lte_tap_for_graph_data, NULL);
     if (error_string) {
         fprintf(stderr, "wireshark: Couldn't register rlc_graph tap: %s\n",
-                error_string);
-        wmem_free(NULL, error_string);
+                error_string->str);
+        g_string_free(error_string, TRUE);
         exit(1);   /* XXX: fix this */
     }
     cf_retap_packets(cf);
index 3ace8546a1ac9c4fc8eaf8a72f4897b89c854f4e..d5e6faf179ee6d9f5160ca6dd36355f6a2a4e8dc 100644 (file)
@@ -1239,13 +1239,13 @@ sctp_stat_get_info(void)
 void
 register_tap_listener_sctp_stat(void)
 {
-       gchar *error_string;
+       GString *error_string;
 
        if (!sctp_tapinfo_struct.is_registered)
        {
                if ((error_string = register_tap_listener("sctp", &sctp_tapinfo_struct, NULL, 0, reset, packet, NULL))) {
-                       simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string);
-                       wmem_free(NULL, error_string);
+                       simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
+                       g_string_free(error_string, TRUE);
                        return;
                }
                sctp_tapinfo_struct.is_registered=TRUE;
index 7e40785cf92d5d86cda0b6b031a5d1a741d25f0e..abf357683de322adf456b4170b78afa5fbe979b5 100644 (file)
@@ -116,7 +116,7 @@ void
 graph_segment_list_get(capture_file *cf, struct tcp_graph *tg, gboolean stream_known)
 {
     struct segment current;
-    gchar    *error_string;
+    GString    *error_string;
     tcp_scan_t  ts;
 
     g_log(NULL, G_LOG_LEVEL_DEBUG, "graph_segment_list_get()");
@@ -152,8 +152,8 @@ graph_segment_list_get(capture_file *cf, struct tcp_graph *tg, gboolean stream_k
     error_string = register_tap_listener("tcp", &ts, "tcp", 0, NULL, tapall_tcpip_packet, NULL);
     if (error_string) {
         fprintf(stderr, "wireshark: Couldn't register tcp_graph tap: %s\n",
-                error_string);
-        wmem_free(NULL, error_string);
+                error_string->str);
+        g_string_free(error_string, TRUE);
         exit(1);   /* XXX: fix this */
     }
     cf_retap_packets(cf);
@@ -288,7 +288,7 @@ select_tcpip_session(capture_file *cf, struct segment *hdrs)
     epan_dissect_t  edt;
     dfilter_t      *sfcode;
     gchar          *err_msg;
-    gchar          *error_string;
+    GString        *error_string;
     nstime_t        rel_ts;
     th_t th = {0, {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}};
 
@@ -312,8 +312,8 @@ select_tcpip_session(capture_file *cf, struct segment *hdrs)
     error_string=register_tap_listener("tcp", &th, NULL, 0, NULL, tap_tcpip_packet, NULL);
     if (error_string) {
         fprintf(stderr, "wireshark: Couldn't register tcp_graph tap: %s\n",
-                error_string);
-        wmem_free(NULL, error_string);
+                error_string->str);
+        g_string_free(error_string, TRUE);
         exit(1);
     }
 
index 87420435c39396e1a4c8841d3f722b63dc955118..a151e725671a1bf705b491b514fcad8233d12315 100644 (file)
@@ -177,11 +177,13 @@ exp_pdu_close(exp_pdu_t *exp_pdu_tap_data)
 char *
 exp_pdu_pre_open(const char *tap_name, const char *filter, exp_pdu_t *exp_pdu_tap_data)
 {
+    GString        *error_string;
+
     /* XXX: can we always assume WTAP_ENCAP_WIRESHARK_UPPER_PDU? */
     exp_pdu_tap_data->pkt_encap = wtap_wtap_encap_to_pcap_encap(WTAP_ENCAP_WIRESHARK_UPPER_PDU);
 
     /* Register this tap listener now */
-    return register_tap_listener(tap_name,             /* The name of the tap we want to listen to */
+    error_string = register_tap_listener(tap_name,             /* The name of the tap we want to listen to */
                                          exp_pdu_tap_data,     /* instance identifier/pointer to a struct holding
                                                                 * all state variables */
                                          filter,               /* pointer to a filter string */
@@ -189,6 +191,10 @@ exp_pdu_pre_open(const char *tap_name, const char *filter, exp_pdu_t *exp_pdu_ta
                                          NULL,
                                          export_pdu_packet,
                                          NULL);
+    if (error_string != NULL)
+        return g_string_free(error_string, FALSE);
+
+    return NULL;
 }
 
 
index 2f180b3adcecdc584bb014ad0e74af5538bafa6f..609ead9fbab1e50ff7a5bf8c6288555e72df7e55 100644 (file)
@@ -532,7 +532,7 @@ rtp_event_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt _
 void
 rtp_event_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("rtpevent", tap_base_to_id(tap_id_base, tap_id_offset_rtp_event_),
             NULL,
@@ -544,8 +544,8 @@ rtp_event_init_tap(voip_calls_tapinfo_t *tap_id_base)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -840,7 +840,7 @@ rtp_packet_draw(void *tap_offset_ptr)
 void
 rtp_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("rtp", tap_base_to_id(tap_id_base, tap_id_offset_rtp_), NULL,
             0,
@@ -850,8 +850,8 @@ rtp_init_tap(voip_calls_tapinfo_t *tap_id_base)
             );
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -1036,7 +1036,7 @@ t38_draw(void *tap_offset_ptr)
 void
 t38_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("t38", tap_base_to_id(tap_id_base, tap_id_offset_t38_), NULL,
             0,
@@ -1046,8 +1046,8 @@ t38_init_tap(voip_calls_tapinfo_t *tap_id_base)
             );
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -1267,7 +1267,7 @@ sip_calls_draw(void *tap_offset_ptr)
 void
 sip_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("sip", tap_base_to_id(tap_id_base, tap_id_offset_sip_), NULL,
             0,
@@ -1277,8 +1277,8 @@ sip_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
             );
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -1470,7 +1470,7 @@ isup_calls_draw(void *tap_offset_ptr)
 void
 isup_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("isup", tap_base_to_id(tap_id_base, tap_id_offset_isup_),
             NULL,
@@ -1482,8 +1482,8 @@ isup_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -1523,7 +1523,7 @@ mtp3_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt
 void
 mtp3_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("mtp3", tap_base_to_id(tap_id_base, tap_id_offset_mtp3_),
             NULL,
@@ -1535,8 +1535,8 @@ mtp3_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 
     error_string = register_tap_listener("m3ua", tap_base_to_id(tap_id_base, tap_id_offset_m3ua_),
@@ -1549,8 +1549,8 @@ mtp3_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 
 }
@@ -1851,7 +1851,7 @@ q931_calls_draw(void *tap_offset_ptr)
 void
 q931_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("q931", tap_base_to_id(tap_id_base, tap_id_offset_q931_),
             NULL,
@@ -1863,8 +1863,8 @@ q931_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -2144,7 +2144,7 @@ h225_calls_draw(void *tap_offset_ptr)
 void
 h225_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("h225", tap_base_to_id(tap_id_base, tap_id_offset_h225_), NULL,
             0,
@@ -2155,8 +2155,8 @@ h225_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -2304,7 +2304,7 @@ h245dg_calls_draw(void *tap_offset_ptr)
 void
 h245dg_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     if (!tap_id_base->h245_labels) {
         tap_id_base->h245_labels = g_new0(h245_labels_t, 1);
@@ -2319,8 +2319,8 @@ h245dg_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -2378,7 +2378,7 @@ sdp_calls_draw(void *tap_offset_ptr)
 void
 sdp_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("sdp", tap_base_to_id(tap_id_base, tap_id_offset_sdp_), NULL,
             0,
@@ -2389,8 +2389,8 @@ sdp_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -2752,7 +2752,7 @@ mgcp_calls_draw(void *tap_offset_ptr)
 void
 mgcp_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     /*
      * We set TL_REQUIRES_PROTO_TREE to force a non-null "tree"
@@ -2770,8 +2770,8 @@ mgcp_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
             );
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -2885,7 +2885,7 @@ actrace_calls_draw(void *tap_offset_ptr)
 void
 actrace_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("actrace", tap_base_to_id(tap_id_base, tap_id_offset_actrace_), NULL,
             0,
@@ -2896,8 +2896,8 @@ actrace_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -3056,7 +3056,7 @@ megaco_calls_draw(void *tap_offset_ptr)
 void
 h248_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("megaco", tap_base_to_id(tap_id_base, tap_id_offset_megaco_),
             NULL,
@@ -3067,8 +3067,8 @@ h248_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 
     error_string = register_tap_listener("h248", tap_base_to_id(tap_id_base, tap_id_offset_h248_),
@@ -3080,8 +3080,8 @@ h248_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -3249,7 +3249,7 @@ sua_calls_draw(void *tap_offset_ptr)
 
 void sccp_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("sccp", tap_base_to_id(tap_id_base, tap_id_offset_sccp_),
             NULL,
@@ -3260,8 +3260,8 @@ void sccp_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 
     error_string = register_tap_listener("sua", tap_base_to_id(tap_id_base, tap_id_offset_sua_),
@@ -3273,8 +3273,8 @@ void sccp_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -3772,7 +3772,7 @@ unistim_calls_draw(void *tap_offset_ptr)
 void
 unistim_calls_init_tap(voip_calls_tapinfo_t *tap_id_base) {
 
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("unistim", tap_base_to_id(tap_id_base, tap_id_offset_unistim_),
             NULL,
@@ -3784,8 +3784,8 @@ unistim_calls_init_tap(voip_calls_tapinfo_t *tap_id_base) {
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -3933,7 +3933,7 @@ skinny_calls_draw(void *tap_offset_ptr)
 void
 skinny_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     /*
      * We set TL_REQUIRES_PROTO_TREE to force a non-null "tree"
@@ -3951,8 +3951,8 @@ skinny_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
             );
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -4072,7 +4072,7 @@ iax2_calls_draw(void *tap_offset_ptr)
 void
 iax2_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     /*
      * We set TL_REQUIRES_PROTO_TREE to force a non-null "tree"
@@ -4093,8 +4093,8 @@ iax2_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
             );
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s",
-                error_string);
-        wmem_free(NULL, error_string);
+                error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
@@ -4195,7 +4195,7 @@ voip_calls_draw(void *tap_offset_ptr)
 void
 voip_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 {
-    gchar *error_string;
+    GString *error_string;
 
     error_string = register_tap_listener("voip", tap_base_to_id(tap_id_base, tap_id_offset_voip_),
             NULL,
@@ -4207,8 +4207,8 @@ voip_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
 
     if (error_string != NULL) {
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
-                "%s", error_string);
-        wmem_free(NULL, error_string);
+                "%s", error_string->str);
+        g_string_free(error_string, TRUE);
     }
 }
 
index 094b482b49d08a42c9b51a8e95c68afa5794d960..6b54f99f5b2e7739c40d51169a2bce009384e49b 100644 (file)
@@ -540,16 +540,6 @@ int main(int argc, char *argv[])
 
     init_open_routines();
 
-    /* Register all dissectors; we must do this before checking for the
-       "-G" flag, as the "-G" flag dumps information registered by the
-       dissectors, and we must do it before we read the preferences, in
-       case any dissectors register preferences. */
-    if (!epan_init(register_all_protocols,register_all_protocol_handoffs,
-                   splash_update, NULL)) {
-        SimpleDialog::displayQueuedMessages(main_w);
-        return 2;
-    }
-
 #ifdef HAVE_PLUGINS
     /* Register all the plugin types we have. */
     epan_register_plugin_types(); /* Types known to libwireshark */
@@ -567,6 +557,16 @@ int main(int argc, char *argv[])
     register_all_codecs();
 #endif
 
+    /* Register all dissectors; we must do this before checking for the
+       "-G" flag, as the "-G" flag dumps information registered by the
+       dissectors, and we must do it before we read the preferences, in
+       case any dissectors register preferences. */
+    if (!epan_init(register_all_protocols,register_all_protocol_handoffs,
+                   splash_update, NULL)) {
+        SimpleDialog::displayQueuedMessages(main_w);
+        return 2;
+    }
+
     splash_update(RA_LISTENERS, NULL, NULL);
 
     /* Register all tap listeners; we do this before we parse the arguments,