From 486d2ff0eb3d20798debdb7e34b5c2ff77d18bab Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 6 Nov 2013 01:31:23 +0200 Subject: [PATCH] hostapd: Deinit ctrl_iface in case of add interface failure 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 --- src/ap/hostapd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index e2a1a5f51..63f7565b3 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -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);