prefs: plug a memory leak.
Don't allocate the cols_hidden GString until we know we need it. Change-Id: I02966d2820efeb5d61d259a567bf9063d8b519f1 Ping-Bug: 16335 Reviewed-on: https://code.wireshark.org/review/37043 Petri-Dish: Guy Harris <gharris@sonic.net> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <gharris@sonic.net>
This commit is contained in:
parent
95073e299c
commit
bab7b8d638
|
@ -2498,7 +2498,7 @@ column_hidden_type_description_cb(void)
|
||||||
static char *
|
static char *
|
||||||
column_hidden_to_str_cb(pref_t* pref, gboolean default_val)
|
column_hidden_to_str_cb(pref_t* pref, gboolean default_val)
|
||||||
{
|
{
|
||||||
GString *cols_hidden = g_string_new ("");
|
GString *cols_hidden;
|
||||||
GList *clp;
|
GList *clp;
|
||||||
fmt_data *cfmt;
|
fmt_data *cfmt;
|
||||||
pref_t *format_pref;
|
pref_t *format_pref;
|
||||||
|
@ -2506,6 +2506,7 @@ column_hidden_to_str_cb(pref_t* pref, gboolean default_val)
|
||||||
if (default_val)
|
if (default_val)
|
||||||
return g_strdup(pref->default_val.string);
|
return g_strdup(pref->default_val.string);
|
||||||
|
|
||||||
|
cols_hidden = g_string_new("");
|
||||||
format_pref = prefs_find_preference(gui_column_module, PRS_COL_FMT);
|
format_pref = prefs_find_preference(gui_column_module, PRS_COL_FMT);
|
||||||
clp = (format_pref) ? *format_pref->varp.list : NULL;
|
clp = (format_pref) ? *format_pref->varp.list : NULL;
|
||||||
while (clp) {
|
while (clp) {
|
||||||
|
|
Loading…
Reference in New Issue