From 33b0b330cea7986c36e9ca801f1718a69dd2d2b7 Mon Sep 17 00:00:00 2001 From: Kyeyoon Park Date: Tue, 29 Oct 2013 16:32:23 +0200 Subject: [PATCH] hostapd: Fix error path in hostapd_add_iface() Incorrect count variable was used in freeing up the BSS data. Signed-hostap: Jouni Malinen --- src/ap/hostapd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 26b3e89cd..48cf5a093 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -1406,7 +1406,11 @@ fail: if (conf) hostapd_config_free(conf); if (hapd_iface) { - os_free(hapd_iface->bss[interfaces->count]); + if (hapd_iface->bss) { + for (i = 0; i < hapd_iface->num_bss; i++) + os_free(hapd_iface->bss[i]); + os_free(hapd_iface->bss); + } os_free(hapd_iface); } return -1;