From 5dbd3bf9155de273b067b5a3ae0742caaaa1586a Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 26 Jul 2015 12:08:17 +0300 Subject: [PATCH] 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 --- wpa_supplicant/ctrl_iface.c | 4 ++++ 1 file changed, 4 insertions(+) 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);