]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix hostapd_add_iface error path to deinit partially initialized BSS
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 14 Mar 2014 19:10:47 +0000 (21:10 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 14 Mar 2014 19:58:46 +0000 (21:58 +0200)
It was possible for the control interface and some of the BSS setup to
be left partially initialized in failure cases while the BSS structures
were still freed. Fix this by properly cleaning up anything that may
have passed initialization successfully before freeing memory.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/hostapd.c

index 5833b828e750798dae5663b887429efea334c313..4ed718cf2cb9182cf41195b83c573c4827180e79 100644 (file)
@@ -1837,6 +1837,7 @@ int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf)
                        if (start_ctrl_iface_bss(hapd) < 0 ||
                            (hapd_iface->state == HAPD_IFACE_ENABLED &&
                             hostapd_setup_bss(hapd, -1))) {
+                               hostapd_cleanup(hapd);
                                hapd_iface->bss[hapd_iface->num_bss - 1] = NULL;
                                hapd_iface->conf->num_bss--;
                                hapd_iface->num_bss--;