aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/airpcap_gui_utils.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-10-07 14:24:56 +0200
committerPeter Wu <peter@lekensteyn.nl>2015-10-09 14:35:41 +0000
commita7ab4af2ab4db5d5fdd5d489bf6b4171a8b1b8d9 (patch)
tree8514746965e6d6f5865555d323d2fae3039c9a9b /ui/gtk/airpcap_gui_utils.c
parent3dd7e69ed7c72594f676396be822d35b130ab2e6 (diff)
airpdcap: add free_key_string function, fix memleaks
Do not leak the key and SSID. Note that there are still some leaks in the GTK UI related to get_wireshark_keys(), but I did not track them down. Caught by LeakSanitizer. Change-Id: I639166e6ea457605d6ae0ebd58e56d7594a7b7db Reviewed-on: https://code.wireshark.org/review/10860 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'ui/gtk/airpcap_gui_utils.c')
-rw-r--r--ui/gtk/airpcap_gui_utils.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/ui/gtk/airpcap_gui_utils.c b/ui/gtk/airpcap_gui_utils.c
index 50a83eb741..c4c3f18e95 100644
--- a/ui/gtk/airpcap_gui_utils.c
+++ b/ui/gtk/airpcap_gui_utils.c
@@ -544,7 +544,6 @@ static gboolean
load_wlan_driver_wep_keys(void)
{
keys_cb_data_t* user_data;
- guint i;
/* Retrieve the wlan preferences */
wlan_prefs = prefs_find_module("wlan");
@@ -574,10 +573,7 @@ load_wlan_driver_wep_keys(void)
/* FREE MEMORY */
/* free the WEP key string */
- for(i=0;i<g_list_length(user_data->list);i++)
- {
- g_free(g_list_nth(user_data->list,i)->data);
- }
+ g_list_foreach(user_data->list, (GFunc)free_key_string, NULL);
/* free the (empty) list */
g_list_free(user_data->list);