aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk
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/gtk
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/gtk')
-rw-r--r--ui/gtk/compare_stat.c6
-rw-r--r--ui/gtk/conversations_table.c12
-rw-r--r--ui/gtk/dcerpc_stat.c6
-rw-r--r--ui/gtk/expert_comp_dlg.c20
-rw-r--r--ui/gtk/export_object_dlg.c6
-rw-r--r--ui/gtk/follow_stream.c5
-rw-r--r--ui/gtk/gsm_map_summary.c6
-rw-r--r--ui/gtk/hostlist_table.c12
-rw-r--r--ui/gtk/iax2_analysis.c6
-rw-r--r--ui/gtk/io_stat.c6
-rw-r--r--ui/gtk/lbm_stream_dlg.c6
-rw-r--r--ui/gtk/lbm_uimflow_dlg.c6
-rw-r--r--ui/gtk/mac_lte_stat_dlg.c6
-rw-r--r--ui/gtk/main.c5
-rw-r--r--ui/gtk/mtp3_summary.c6
-rw-r--r--ui/gtk/response_time_delay_table.c6
-rw-r--r--ui/gtk/rlc_lte_stat_dlg.c6
-rw-r--r--ui/gtk/rpc_stat.c6
-rw-r--r--ui/gtk/rtp_analysis.c6
-rw-r--r--ui/gtk/sctp_chunk_stat.c6
-rw-r--r--ui/gtk/service_response_time_table.c6
-rw-r--r--ui/gtk/simple_stattable.c6
-rw-r--r--ui/gtk/stats_tree_stat.c6
-rw-r--r--ui/gtk/wlan_stat_dlg.c12
24 files changed, 89 insertions, 85 deletions
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;
}