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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-07-26 12:08:17 +03:00
parent 6e2536fc79
commit 5dbd3bf915

View file

@ -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)) { if (!fst_parse_attach_command(cmd, ifname, sizeof(ifname), &cfg)) {
wpa_s = wpa_supplicant_get_iface(global, ifname); wpa_s = wpa_supplicant_get_iface(global, ifname);
if (wpa_s) { 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); fst_wpa_supplicant_fill_iface_obj(wpa_s, &iface_obj);
wpa_s->fst = fst_attach(ifname, wpa_s->own_addr, wpa_s->fst = fst_attach(ifname, wpa_s->own_addr,
&iface_obj, &cfg); &iface_obj, &cfg);