diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2016-06-19 11:01:56 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2016-06-19 10:47:10 +0000 |
commit | a383e692c8774c2451a55d8b3f8ef9db5d037329 (patch) | |
tree | ab6223527915ab1127a50563981816adc18b971f /ui | |
parent | ff845123f1f1ecef0d8e0d8980e6e9d7267e5f6b (diff) |
Revert "tap: change glib functions to wmem."
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>
Diffstat (limited to 'ui')
70 files changed, 292 insertions, 284 deletions
diff --git a/ui/cli/tap-camelsrt.c b/ui/cli/tap-camelsrt.c index 7e64bf6449..6277d357d8 100644 --- a/ui/cli/tap-camelsrt.c +++ b/ui/cli/tap-camelsrt.c @@ -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); } diff --git a/ui/cli/tap-comparestat.c b/ui/cli/tap-comparestat.c index e11b1a132d..286310103a 100644 --- a/ui/cli/tap-comparestat.c +++ b/ui/cli/tap-comparestat.c @@ -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); } } diff --git a/ui/cli/tap-diameter-avp.c b/ui/cli/tap-diameter-avp.c index 51223c8711..02106cd9f4 100644 --- a/ui/cli/tap-diameter-avp.c +++ b/ui/cli/tap-diameter-avp.c @@ -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); } } diff --git a/ui/cli/tap-endpoints.c b/ui/cli/tap-endpoints.c index 9aec736047..5e261bd29b 100644 --- a/ui/cli/tap-endpoints.c +++ b/ui/cli/tap-endpoints.c @@ -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); } diff --git a/ui/cli/tap-expert.c b/ui/cli/tap-expert.c index be92d150dd..07fdfb5f6c 100644 --- a/ui/cli/tap-expert.c +++ b/ui/cli/tap-expert.c @@ -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); } diff --git a/ui/cli/tap-follow.c b/ui/cli/tap-follow.c index cfce4a9c9c..9d2b2d0cc9 100644 --- a/ui/cli/tap-follow.c +++ b/ui/cli/tap-follow.c @@ -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."); } } diff --git a/ui/cli/tap-gsm_astat.c b/ui/cli/tap-gsm_astat.c index 7dc26e3d07..8b5bb2b5ab 100644 --- a/ui/cli/tap-gsm_astat.c +++ b/ui/cli/tap-gsm_astat.c @@ -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); } diff --git a/ui/cli/tap-hosts.c b/ui/cli/tap-hosts.c index 1837738b09..f81a9fc739 100644 --- a/ui/cli/tap-hosts.c +++ b/ui/cli/tap-hosts.c @@ -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); } } diff --git a/ui/cli/tap-httpstat.c b/ui/cli/tap-httpstat.c index ae49a0fce8..6b7334b223 100644 --- a/ui/cli/tap-httpstat.c +++ b/ui/cli/tap-httpstat.c @@ -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); } diff --git a/ui/cli/tap-icmpstat.c b/ui/cli/tap-icmpstat.c index 6db273b0de..9102cf32fe 100644 --- a/ui/cli/tap-icmpstat.c +++ b/ui/cli/tap-icmpstat.c @@ -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); } } diff --git a/ui/cli/tap-icmpv6stat.c b/ui/cli/tap-icmpv6stat.c index 9c5d372684..6c2a59d0d7 100644 --- a/ui/cli/tap-icmpv6stat.c +++ b/ui/cli/tap-icmpv6stat.c @@ -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); } } diff --git a/ui/cli/tap-iostat.c b/ui/cli/tap-iostat.c index 5d3e6ee601..d481e1e898 100644 --- a/ui/cli/tap-iostat.c +++ b/ui/cli/tap-iostat.c @@ -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); } } diff --git a/ui/cli/tap-iousers.c b/ui/cli/tap-iousers.c index fb7e0d2f46..06f02697ac 100644 --- a/ui/cli/tap-iousers.c +++ b/ui/cli/tap-iousers.c @@ -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); } diff --git a/ui/cli/tap-macltestat.c b/ui/cli/tap-macltestat.c index d5afbdd4eb..c50dab9a87 100644 --- a/ui/cli/tap-macltestat.c +++ b/ui/cli/tap-macltestat.c @@ -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); } diff --git a/ui/cli/tap-protocolinfo.c b/ui/cli/tap-protocolinfo.c index 8be62703ee..23581bc127 100644 --- a/ui/cli/tap-protocolinfo.c +++ b/ui/cli/tap-protocolinfo.c @@ -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); diff --git a/ui/cli/tap-protohierstat.c b/ui/cli/tap-protohierstat.c index 24d8365c46..6fe4096a69 100644 --- a/ui/cli/tap-protohierstat.c +++ b/ui/cli/tap-protohierstat.c @@ -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); } } diff --git a/ui/cli/tap-rlcltestat.c b/ui/cli/tap-rlcltestat.c index 1cbe48eb4e..546d2a246a 100644 --- a/ui/cli/tap-rlcltestat.c +++ b/ui/cli/tap-rlcltestat.c @@ -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); } diff --git a/ui/cli/tap-rpcprogs.c b/ui/cli/tap-rpcprogs.c index ee2c9e7b77..798062087d 100644 --- a/ui/cli/tap-rpcprogs.c +++ b/ui/cli/tap-rpcprogs.c @@ -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); } } diff --git a/ui/cli/tap-rtd.c b/ui/cli/tap-rtd.c index c37d02713a..2e43286b62 100644 --- a/ui/cli/tap-rtd.c +++ b/ui/cli/tap-rtd.c @@ -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); } } diff --git a/ui/cli/tap-rtp.c b/ui/cli/tap-rtp.c index 230f356087..71243474de 100644 --- a/ui/cli/tap-rtp.c +++ b/ui/cli/tap-rtp.c @@ -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); } diff --git a/ui/cli/tap-rtspstat.c b/ui/cli/tap-rtspstat.c index d91167a30d..20d15e4640 100644 --- a/ui/cli/tap-rtspstat.c +++ b/ui/cli/tap-rtspstat.c @@ -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); } diff --git a/ui/cli/tap-sctpchunkstat.c b/ui/cli/tap-sctpchunkstat.c index cb8efdc42b..2d41d362ae 100644 --- a/ui/cli/tap-sctpchunkstat.c +++ b/ui/cli/tap-sctpchunkstat.c @@ -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); } } diff --git a/ui/cli/tap-simple_stattable.c b/ui/cli/tap-simple_stattable.c index d722ba2f0f..9f52eb458d 100644 --- a/ui/cli/tap-simple_stattable.c +++ b/ui/cli/tap-simple_stattable.c @@ -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); } } diff --git a/ui/cli/tap-sipstat.c b/ui/cli/tap-sipstat.c index bac6b0f4f5..a7936102db 100644 --- a/ui/cli/tap-sipstat.c +++ b/ui/cli/tap-sipstat.c @@ -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); } diff --git a/ui/cli/tap-smbsids.c b/ui/cli/tap-smbsids.c index ce6f3f6be9..0234281e28 100644 --- a/ui/cli/tap-smbsids.c +++ b/ui/cli/tap-smbsids.c @@ -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); } } diff --git a/ui/cli/tap-srt.c b/ui/cli/tap-srt.c index d6a965e484..32fde53594 100644 --- a/ui/cli/tap-srt.c +++ b/ui/cli/tap-srt.c @@ -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); } } diff --git a/ui/cli/tap-stats_tree.c b/ui/cli/tap-stats_tree.c index fedf22da3b..f30a5dc23b 100644 --- a/ui/cli/tap-stats_tree.c +++ b/ui/cli/tap-stats_tree.c @@ -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; } diff --git a/ui/cli/tap-sv.c b/ui/cli/tap-sv.c index 731fe42a67..c7a43ef294 100644 --- a/ui/cli/tap-sv.c +++ b/ui/cli/tap-sv.c @@ -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); } } diff --git a/ui/cli/tap-wspstat.c b/ui/cli/tap-wspstat.c index f65280bbbe..b2a0ba46a8 100644 --- a/ui/cli/tap-wspstat.c +++ b/ui/cli/tap-wspstat.c @@ -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); } } diff --git a/ui/gtk/compare_stat.c b/ui/gtk/compare_stat.c index fe2c5e634a..7239d5bace 100644 --- a/ui/gtk/compare_stat.c +++ b/ui/gtk/compare_stat.c @@ -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); diff --git a/ui/gtk/conversations_table.c b/ui/gtk/conversations_table.c index 4927220aa5..7fc02e2eb0 100644 --- a/ui/gtk/conversations_table.c +++ b/ui/gtk/conversations_table.c @@ -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; } diff --git a/ui/gtk/dcerpc_stat.c b/ui/gtk/dcerpc_stat.c index a846f9c609..e9186fdda7 100644 --- a/ui/gtk/dcerpc_stat.c +++ b/ui/gtk/dcerpc_stat.c @@ -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; diff --git a/ui/gtk/expert_comp_dlg.c b/ui/gtk/expert_comp_dlg.c index 8087b47dda..9450bbbbae 100644 --- a/ui/gtk/expert_comp_dlg.c +++ b/ui/gtk/expert_comp_dlg.c @@ -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; } diff --git a/ui/gtk/export_object_dlg.c b/ui/gtk/export_object_dlg.c index 4233480632..ee1c3af8b3 100644 --- a/ui/gtk/export_object_dlg.c +++ b/ui/gtk/export_object_dlg.c @@ -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; } diff --git a/ui/gtk/follow_stream.c b/ui/gtk/follow_stream.c index ad1e6b8d26..d12a6234c0 100644 --- a/ui/gtk/follow_stream.c +++ b/ui/gtk/follow_stream.c @@ -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; } diff --git a/ui/gtk/gsm_map_summary.c b/ui/gtk/gsm_map_summary.c index 1f261c0fcf..15fd6b9644 100644 --- a/ui/gtk/gsm_map_summary.c +++ b/ui/gtk/gsm_map_summary.c @@ -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); } diff --git a/ui/gtk/hostlist_table.c b/ui/gtk/hostlist_table.c index 1f72114a68..e65f227392 100644 --- a/ui/gtk/hostlist_table.c +++ b/ui/gtk/hostlist_table.c @@ -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; } diff --git a/ui/gtk/iax2_analysis.c b/ui/gtk/iax2_analysis.c index 1cf3b256ea..604f721ba3 100644 --- a/ui/gtk/iax2_analysis.c +++ b/ui/gtk/iax2_analysis.c @@ -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; } diff --git a/ui/gtk/io_stat.c b/ui/gtk/io_stat.c index 6853d2116b..b077429d56 100644 --- a/ui/gtk/io_stat.c +++ b/ui/gtk/io_stat.c @@ -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; diff --git a/ui/gtk/lbm_stream_dlg.c b/ui/gtk/lbm_stream_dlg.c index df99266756..d3fea45ce1 100644 --- a/ui/gtk/lbm_stream_dlg.c +++ b/ui/gtk/lbm_stream_dlg.c @@ -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); } diff --git a/ui/gtk/lbm_uimflow_dlg.c b/ui/gtk/lbm_uimflow_dlg.c index 5ed9e3b625..b0993547b6 100644 --- a/ui/gtk/lbm_uimflow_dlg.c +++ b/ui/gtk/lbm_uimflow_dlg.c @@ -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; } diff --git a/ui/gtk/mac_lte_stat_dlg.c b/ui/gtk/mac_lte_stat_dlg.c index af2e3b0bcb..3057e3e8c2 100644 --- a/ui/gtk/mac_lte_stat_dlg.c +++ b/ui/gtk/mac_lte_stat_dlg.c @@ -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; } diff --git a/ui/gtk/main.c b/ui/gtk/main.c index cd390eca85..bcad63b05b 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -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(); diff --git a/ui/gtk/mtp3_summary.c b/ui/gtk/mtp3_summary.c index c45bc48ba5..1917720449 100644 --- a/ui/gtk/mtp3_summary.c +++ b/ui/gtk/mtp3_summary.c @@ -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); } diff --git a/ui/gtk/response_time_delay_table.c b/ui/gtk/response_time_delay_table.c index fde0258083..fb110fe018 100644 --- a/ui/gtk/response_time_delay_table.c +++ b/ui/gtk/response_time_delay_table.c @@ -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; diff --git a/ui/gtk/rlc_lte_stat_dlg.c b/ui/gtk/rlc_lte_stat_dlg.c index 55aced9fa0..6ff23b3ccd 100644 --- a/ui/gtk/rlc_lte_stat_dlg.c +++ b/ui/gtk/rlc_lte_stat_dlg.c @@ -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; } diff --git a/ui/gtk/rpc_stat.c b/ui/gtk/rpc_stat.c index 5b068a4418..cf18aa910e 100644 --- a/ui/gtk/rpc_stat.c +++ b/ui/gtk/rpc_stat.c @@ -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; diff --git a/ui/gtk/rtp_analysis.c b/ui/gtk/rtp_analysis.c index a9cb508007..daaa6d38e8 100644 --- a/ui/gtk/rtp_analysis.c +++ b/ui/gtk/rtp_analysis.c @@ -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; } diff --git a/ui/gtk/sctp_chunk_stat.c b/ui/gtk/sctp_chunk_stat.c index cbb516df62..edb5de543d 100644 --- a/ui/gtk/sctp_chunk_stat.c +++ b/ui/gtk/sctp_chunk_stat.c @@ -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; diff --git a/ui/gtk/service_response_time_table.c b/ui/gtk/service_response_time_table.c index de4692b58a..c1f615849a 100644 --- a/ui/gtk/service_response_time_table.c +++ b/ui/gtk/service_response_time_table.c @@ -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; diff --git a/ui/gtk/simple_stattable.c b/ui/gtk/simple_stattable.c index a7d60ecd95..669815d916 100644 --- a/ui/gtk/simple_stattable.c +++ b/ui/gtk/simple_stattable.c @@ -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; diff --git a/ui/gtk/stats_tree_stat.c b/ui/gtk/stats_tree_stat.c index 85e8f977fb..7979540f7f 100644 --- a/ui/gtk/stats_tree_stat.c +++ b/ui/gtk/stats_tree_stat.c @@ -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. */ diff --git a/ui/gtk/wlan_stat_dlg.c b/ui/gtk/wlan_stat_dlg.c index ec23d36cd4..9cd9b86181 100644 --- a/ui/gtk/wlan_stat_dlg.c +++ b/ui/gtk/wlan_stat_dlg.c @@ -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; } diff --git a/ui/mcast_stream.c b/ui/mcast_stream.c index 4daca8b7d2..badc1fcf36 100644 --- a/ui/mcast_stream.c +++ b/ui/mcast_stream.c @@ -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); } diff --git a/ui/qt/bluetooth_device_dialog.cpp b/ui/qt/bluetooth_device_dialog.cpp index a3a50d99f9..5c72f2d2a4 100644 --- a/ui/qt/bluetooth_device_dialog.cpp +++ b/ui/qt/bluetooth_device_dialog.cpp @@ -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); } } diff --git a/ui/qt/bluetooth_hci_summary_dialog.cpp b/ui/qt/bluetooth_hci_summary_dialog.cpp index 87aad65e67..a29d3f8136 100644 --- a/ui/qt/bluetooth_hci_summary_dialog.cpp +++ b/ui/qt/bluetooth_hci_summary_dialog.cpp @@ -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); } } diff --git a/ui/qt/expert_info_dialog.cpp b/ui/qt/expert_info_dialog.cpp index 7dfb3101a5..ea19f1f60f 100644 --- a/ui/qt/expert_info_dialog.cpp +++ b/ui/qt/expert_info_dialog.cpp @@ -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; } } diff --git a/ui/qt/gsm_map_summary_dialog.cpp b/ui/qt/gsm_map_summary_dialog.cpp index 2ad0c5c0c1..3265068e94 100644 --- a/ui/qt/gsm_map_summary_dialog.cpp +++ b/ui/qt/gsm_map_summary_dialog.cpp @@ -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); } diff --git a/ui/qt/io_graph_dialog.cpp b/ui/qt/io_graph_dialog.cpp index 3b18fffb0d..7270d49572 100644 --- a/ui/qt/io_graph_dialog.cpp +++ b/ui/qt/io_graph_dialog.cpp @@ -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_) { diff --git a/ui/qt/lbm_lbtrm_transport_dialog.cpp b/ui/qt/lbm_lbtrm_transport_dialog.cpp index 87a8b03b08..b232f927ed 100644 --- a/ui/qt/lbm_lbtrm_transport_dialog.cpp +++ b/ui/qt/lbm_lbtrm_transport_dialog.cpp @@ -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(); } diff --git a/ui/qt/lbm_lbtru_transport_dialog.cpp b/ui/qt/lbm_lbtru_transport_dialog.cpp index 65982b2d73..a787b12808 100644 --- a/ui/qt/lbm_lbtru_transport_dialog.cpp +++ b/ui/qt/lbm_lbtru_transport_dialog.cpp @@ -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(); } diff --git a/ui/qt/lbm_stream_dialog.cpp b/ui/qt/lbm_stream_dialog.cpp index 1aa90d8b90..000527a679 100644 --- a/ui/qt/lbm_stream_dialog.cpp +++ b/ui/qt/lbm_stream_dialog.cpp @@ -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(); } diff --git a/ui/qt/mtp3_summary_dialog.cpp b/ui/qt/mtp3_summary_dialog.cpp index 2611238469..f009f939e9 100644 --- a/ui/qt/mtp3_summary_dialog.cpp +++ b/ui/qt/mtp3_summary_dialog.cpp @@ -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); } diff --git a/ui/qt/wireshark_dialog.cpp b/ui/qt/wireshark_dialog.cpp index 37066f8e0a..ba5cd12bb1 100644 --- a/ui/qt/wireshark_dialog.cpp +++ b/ui/qt/wireshark_dialog.cpp @@ -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; } diff --git a/ui/rtp_stream.c b/ui/rtp_stream.c index afaf678a25..01b6198345 100644 --- a/ui/rtp_stream.c +++ b/ui/rtp_stream.c @@ -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); } diff --git a/ui/tap-rlc-graph.c b/ui/tap-rlc-graph.c index 38980f991a..e5bb6cfeb5 100644 --- a/ui/tap-rlc-graph.c +++ b/ui/tap-rlc-graph.c @@ -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); diff --git a/ui/tap-sctp-analysis.c b/ui/tap-sctp-analysis.c index 3ace8546a1..d5e6faf179 100644 --- a/ui/tap-sctp-analysis.c +++ b/ui/tap-sctp-analysis.c @@ -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; diff --git a/ui/tap-tcp-stream.c b/ui/tap-tcp-stream.c index 7e40785cf9..abf357683d 100644 --- a/ui/tap-tcp-stream.c +++ b/ui/tap-tcp-stream.c @@ -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); } diff --git a/ui/tap_export_pdu.c b/ui/tap_export_pdu.c index 87420435c3..a151e72567 100644 --- a/ui/tap_export_pdu.c +++ b/ui/tap_export_pdu.c @@ -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; } diff --git a/ui/voip_calls.c b/ui/voip_calls.c index 2f180b3adc..609ead9fba 100644 --- a/ui/voip_calls.c +++ b/ui/voip_calls.c @@ -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); } } |