aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-04-23 15:07:41 (GMT)
committerJouni Malinen <j@w1.fi>2013-04-23 15:07:41 (GMT)
commit18e00b5e4dfc30e27c76b9563cab618c381c74e7 (patch)
treed7c8d069193feb8a99ceacab0e1ab78bb867d49c /wpa_supplicant
parent754632c965a4c2a65d9d289745245a572351081d (diff)
downloadhostap-18e00b5e4dfc30e27c76b9563cab618c381c74e7.zip
hostap-18e00b5e4dfc30e27c76b9563cab618c381c74e7.tar.gz
hostap-18e00b5e4dfc30e27c76b9563cab618c381c74e7.tar.bz2
Move wpa_s freeing into wpa_supplicant_deinit_iface()
All wpa_supplicant_deinit_iface() callers ended up freeing wpa_s immediately after this call. Move os_free(wpa_s) into the deinit function to share the same call and make the deinit sequence clearer. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/wpa_supplicant.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 8a7bbd9..dc404a3 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -3055,6 +3055,8 @@ static void wpa_supplicant_deinit_iface(struct wpa_supplicant *wpa_s,
wpa_config_free(wpa_s->conf);
wpa_s->conf = NULL;
}
+
+ os_free(wpa_s);
}
@@ -3105,14 +3107,12 @@ struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
wpa_printf(MSG_DEBUG, "Failed to add interface %s",
iface->ifname);
wpa_supplicant_deinit_iface(wpa_s, 0, 0);
- os_free(wpa_s);
return NULL;
}
/* Notify the control interfaces about new iface */
if (wpas_notify_iface_added(wpa_s)) {
wpa_supplicant_deinit_iface(wpa_s, 1, 0);
- os_free(wpa_s);
return NULL;
}
@@ -3165,7 +3165,6 @@ int wpa_supplicant_remove_iface(struct wpa_global *global,
if (global->p2p_invite_group == wpa_s)
global->p2p_invite_group = NULL;
wpa_supplicant_deinit_iface(wpa_s, 1, terminate);
- os_free(wpa_s);
return 0;
}