Fix hostapd interface addition error path
authorJouni Malinen <j@w1.fi>
Thu, 8 Jan 2015 00:13:46 +0000 (02:13 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 8 Jan 2015 00:34:08 +0000 (02:34 +0200)
The local conf pointer needs to be cleared once it gets assigned to
hapd_iface to avoid double-free of the configuration data on error path.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/hostapd.c

index b4a6a96..6e4169b 100644 (file)
@@ -2028,11 +2028,13 @@ int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf)
                           "for hostapd", __func__);
                goto fail;
        }
+       conf = NULL;
 
        if (start_ctrl_iface(hapd_iface) < 0)
                goto fail;
 
-       wpa_printf(MSG_INFO, "Add interface '%s'", conf->bss[0]->iface);
+       wpa_printf(MSG_INFO, "Add interface '%s'",
+                  hapd_iface->conf->bss[0]->iface);
 
        return 0;