aboutsummaryrefslogtreecommitdiffstats
path: root/ui/cli
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2016-06-19 11:01:56 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2016-06-19 10:47:10 +0000
commita383e692c8774c2451a55d8b3f8ef9db5d037329 (patch)
treeab6223527915ab1127a50563981816adc18b971f /ui/cli
parentff845123f1f1ecef0d8e0d8980e6e9d7267e5f6b (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/cli')
-rw-r--r--ui/cli/tap-camelsrt.c6
-rw-r--r--ui/cli/tap-comparestat.c6
-rw-r--r--ui/cli/tap-diameter-avp.c6
-rw-r--r--ui/cli/tap-endpoints.c6
-rw-r--r--ui/cli/tap-expert.c6
-rw-r--r--ui/cli/tap-follow.c4
-rw-r--r--ui/cli/tap-gsm_astat.c4
-rw-r--r--ui/cli/tap-hosts.c6
-rw-r--r--ui/cli/tap-httpstat.c6
-rw-r--r--ui/cli/tap-icmpstat.c6
-rw-r--r--ui/cli/tap-icmpv6stat.c6
-rw-r--r--ui/cli/tap-iostat.c6
-rw-r--r--ui/cli/tap-iousers.c6
-rw-r--r--ui/cli/tap-macltestat.c4
-rw-r--r--ui/cli/tap-protocolinfo.c6
-rw-r--r--ui/cli/tap-protohierstat.c6
-rw-r--r--ui/cli/tap-rlcltestat.c4
-rw-r--r--ui/cli/tap-rpcprogs.c6
-rw-r--r--ui/cli/tap-rtd.c6
-rw-r--r--ui/cli/tap-rtp.c4
-rw-r--r--ui/cli/tap-rtspstat.c6
-rw-r--r--ui/cli/tap-sctpchunkstat.c6
-rw-r--r--ui/cli/tap-simple_stattable.c6
-rw-r--r--ui/cli/tap-sipstat.c6
-rw-r--r--ui/cli/tap-smbsids.c6
-rw-r--r--ui/cli/tap-srt.c6
-rw-r--r--ui/cli/tap-stats_tree.c5
-rw-r--r--ui/cli/tap-sv.c6
-rw-r--r--ui/cli/tap-wspstat.c6
29 files changed, 81 insertions, 82 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);
}
}