]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Deinit ctrl_iface in case of add interface failure
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 5 Nov 2013 23:31:23 +0000 (01:31 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 5 Nov 2013 23:32:55 +0000 (01:32 +0200)
Since the control interface is now initialized as part of
hostapd_setup_interface(), it needs to be deinitialized on the error
path.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/ap/hostapd.c

index e2a1a5f5130bc652de3663ba35c24b32239fba8f..63f7565b38f444be9dc9a5b94b371d2467948e08 100644 (file)
@@ -1806,8 +1806,14 @@ fail:
                hostapd_config_free(conf);
        if (hapd_iface) {
                if (hapd_iface->bss) {
-                       for (i = 0; i < hapd_iface->num_bss; i++)
+                       for (i = 0; i < hapd_iface->num_bss; i++) {
+                               hapd = hapd_iface->bss[i];
+                               if (hapd && hapd_iface->interfaces &&
+                                   hapd_iface->interfaces->ctrl_iface_deinit)
+                                       hapd_iface->interfaces->
+                                               ctrl_iface_deinit(hapd);
                                os_free(hapd_iface->bss[i]);
+                       }
                        os_free(hapd_iface->bss);
                }
                os_free(hapd_iface);