diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-06-03 22:03:05 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-06-03 22:03:05 +0000 |
commit | dbfb305368f0178348fd613665a5f5bf05f62d8a (patch) | |
tree | b9609c547a4181a21a0de0b99e1e22a577782b69 /ui/gtk/wlan_stat_dlg.c | |
parent | d1c1455882aa50f5ffdb5ba5dfdd6c4a4a45f649 (diff) | |
download | wireshark-dbfb305368f0178348fd613665a5f5bf05f62d8a.tar.gz |
g_filename_display_basename() returns a g_mallocated string, so its
callers either need to free it or their callers need to free it or....
This means that cf_get_display_name() must always return a g_mallocated
string and its callers or... must free it.
For some of those callers, create a new set_window_title() routine to do
the work - they're all using the same pattern.
svn path=/trunk/; revision=43047
Diffstat (limited to 'ui/gtk/wlan_stat_dlg.c')
-rw-r--r-- | ui/gtk/wlan_stat_dlg.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ui/gtk/wlan_stat_dlg.c b/ui/gtk/wlan_stat_dlg.c index 777fb4fe9d..612d2b7ca4 100644 --- a/ui/gtk/wlan_stat_dlg.c +++ b/ui/gtk/wlan_stat_dlg.c @@ -159,14 +159,17 @@ wlanstat_reset (void *phs) wlanstat_t* wlan_stat = (wlanstat_t *)phs; wlan_ep_t* list = wlan_stat->ep_list; wlan_ep_t* tmp = NULL; + char *display_name; char title[256]; GString *error_string; GtkListStore *store; const char *filter = NULL; if (wlanstat_dlg_w != NULL) { - g_snprintf (title, sizeof(title), "Wireshark: WLAN Traffic Statistics: %s", - cf_get_display_name(&cfile)); + display_name = cf_get_display_name(&cfile); + g_snprintf (title, sizeof(title), "Wireshark: WLAN Traffic Statistics: %s", + display_name); + g_free(display_name); gtk_window_set_title(GTK_WINDOW(wlanstat_dlg_w), title); } @@ -1739,6 +1742,7 @@ wlanstat_dlg_create (void) GtkCellRenderer *renderer; GtkTreeViewColumn *column; GtkTreeSelection *sel; + char *display_name; char title[256]; gint i; @@ -1750,8 +1754,10 @@ wlanstat_dlg_create (void) hs->use_dfilter = FALSE; hs->show_only_existing = FALSE; + display_name = cf_get_display_name(&cfile); g_snprintf (title, sizeof(title), "Wireshark: WLAN Traffic Statistics: %s", - cf_get_display_name(&cfile)); + display_name); + g_free(display_name); wlanstat_dlg_w = window_new_with_geom (GTK_WINDOW_TOPLEVEL, title, "WLAN Statistics"); gtk_window_set_default_size (GTK_WINDOW(wlanstat_dlg_w), 750, 400); |