aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2017-03-04 11:48:29 (GMT)
committerJouni Malinen <j@w1.fi>2017-03-04 15:30:15 (GMT)
commit4c803dfcd7f019256da808b01c9ddeccafa31a52 (patch)
treef98ddcd2bd8c5b7e31bcf051fe8f58cb404382e6 /src
parent31b398e05fa194d4da1890b2fa9f7d4ab43880fe (diff)
downloadhostap-4c803dfcd7f019256da808b01c9ddeccafa31a52.zip
hostap-4c803dfcd7f019256da808b01c9ddeccafa31a52.tar.gz
hostap-4c803dfcd7f019256da808b01c9ddeccafa31a52.tar.bz2
ACS: Fix memory leak if interface is disabled during scan
The survey data was not freed if hostapd interface got disabled during an ACS scan. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/ap/acs.c2
-rw-r--r--src/ap/acs.h5
-rw-r--r--src/ap/hostapd.c4
3 files changed, 10 insertions, 1 deletions
diff --git a/src/ap/acs.c b/src/ap/acs.c
index 0cef2bf..aa59058 100644
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
@@ -260,7 +260,7 @@ static void acs_clean_chan_surveys(struct hostapd_channel_data *chan)
}
-static void acs_cleanup(struct hostapd_iface *iface)
+void acs_cleanup(struct hostapd_iface *iface)
{
int i;
struct hostapd_channel_data *chan;
diff --git a/src/ap/acs.h b/src/ap/acs.h
index fc85259..ec84f0e 100644
--- a/src/ap/acs.h
+++ b/src/ap/acs.h
@@ -13,6 +13,7 @@
#ifdef CONFIG_ACS
enum hostapd_chan_status acs_init(struct hostapd_iface *iface);
+void acs_cleanup(struct hostapd_iface *iface);
#else /* CONFIG_ACS */
@@ -22,6 +23,10 @@ static inline enum hostapd_chan_status acs_init(struct hostapd_iface *iface)
return HOSTAPD_CHAN_INVALID;
}
+static inline void acs_cleanup(struct hostapd_iface *iface)
+{
+}
+
#endif /* CONFIG_ACS */
#endif /* ACS_H */
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 4ae7520..21023dd 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -46,6 +46,7 @@
#include "neighbor_db.h"
#include "rrm.h"
#include "fils_hlp.h"
+#include "acs.h"
static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason);
@@ -394,8 +395,11 @@ static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface)
hostapd_stop_setup_timers(iface);
#endif /* NEED_AP_MLME */
#endif /* CONFIG_IEEE80211N */
+ if (iface->current_mode)
+ acs_cleanup(iface);
hostapd_free_hw_features(iface->hw_features, iface->num_hw_features);
iface->hw_features = NULL;
+ iface->current_mode = NULL;
os_free(iface->current_rates);
iface->current_rates = NULL;
os_free(iface->basic_rates);