From e10422c025a26dcf4ba96eb819d0f69bc69ef2d2 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 6 Jan 2015 01:39:27 +0200 Subject: [PATCH] Fix memory leak on hostapd BSS addition error path The per-BSS configuration information needs to be freed if hostapd fails to add a new interface for a BSS added with "ADD bss_config=..." command. Signed-off-by: Jouni Malinen --- src/ap/hostapd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 04a0b69db..b4a6a964d 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -1976,6 +1976,8 @@ int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf) hapd_iface->num_bss--; wpa_printf(MSG_DEBUG, "%s: free hapd %p %s", __func__, hapd, hapd->conf->iface); + hostapd_config_free_bss(hapd->conf); + hapd->conf = NULL; os_free(hapd); return -1; }