ui: Fix memory leak on extcap configuration save

Change-Id: I8099fe33fd7a93064d7a9c2220c9b47206bae74f
Reviewed-on: https://code.wireshark.org/review/33282
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Tomasz Moń 2019-05-20 19:33:12 +02:00 committed by Peter Wu
parent 5d2af76c98
commit 3451314e5c
1 changed files with 4 additions and 4 deletions

View File

@ -130,18 +130,18 @@ prefs_store_ext_multiple(const char * module, GHashTable * pref_values)
if ( ! keys )
return pref_changed;
while ( keys != NULL )
for ( GList * key = keys; key != NULL; key = g_list_next(key) )
{
gchar * pref_name = (gchar *)keys->data;
gchar * pref_value = (gchar *) g_hash_table_lookup(pref_values, keys->data);
gchar * pref_name = (gchar *)key->data;
gchar * pref_value = (gchar *) g_hash_table_lookup(pref_values, key->data);
if ( pref_name && pref_value )
{
if ( prefs_store_ext_helper(module, pref_name, pref_value) )
pref_changed = TRUE;
}
keys = g_list_next(keys);
}
g_list_free(keys);
if ( pref_changed )
{