From c1c07dcb702ab6d79c8abe28f452b92956ee508c Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 8 Jan 2015 02:13:46 +0200 Subject: [PATCH] Fix hostapd interface addition error path 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 --- src/ap/hostapd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index b4a6a964d..6e4169ba9 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -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;