From: Jouni Malinen Date: Sun, 26 Jul 2015 09:08:17 +0000 (+0300) Subject: FST: Avoid memory leak on double FST-ATTACH X-Git-Tag: hostap_2_5~306 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5dbd3bf9155de273b067b5a3ae0742caaaa1586a;p=thirdparty%2Fhostap.git FST: Avoid memory leak on double FST-ATTACH Do not allow wpa_s->fst to be replaced when processing FST-ATTACH command for an interface that has already been attached. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 07b7038aa..aad69ec83 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -9194,6 +9194,10 @@ static int wpas_global_ctrl_iface_fst_attach(struct wpa_global *global, if (!fst_parse_attach_command(cmd, ifname, sizeof(ifname), &cfg)) { wpa_s = wpa_supplicant_get_iface(global, ifname); if (wpa_s) { + if (wpa_s->fst) { + wpa_printf(MSG_INFO, "FST: Already attached"); + return -1; + } fst_wpa_supplicant_fill_iface_obj(wpa_s, &iface_obj); wpa_s->fst = fst_attach(ifname, wpa_s->own_addr, &iface_obj, &cfg);