From 4e7d7426aaba30b8d5ca9f14ff02e24857e97ab0 Mon Sep 17 00:00:00 2001 From: ronghulin Date: Tue, 14 Jul 2020 11:59:39 +0800 Subject: [PATCH] bugfix: fix softap mode wpa memory leak --- components/wpa_supplicant/src/esp_supplicant/esp_hostap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_hostap.c b/components/wpa_supplicant/src/esp_supplicant/esp_hostap.c index e1eca8b19..11a0564a6 100644 --- a/components/wpa_supplicant/src/esp_supplicant/esp_hostap.c +++ b/components/wpa_supplicant/src/esp_supplicant/esp_hostap.c @@ -88,7 +88,7 @@ void *hostap_init(void) esp_wifi_get_macaddr_internal(WIFI_IF_AP, mac); hapd->wpa_auth = wpa_init(mac, auth_conf, NULL); - esp_wifi_set_appie_internal(WIFI_APPIE_WPA, hapd->wpa_auth->wpa_ie, (uint16_t)hapd->wpa_auth->wpa_ie_len, 0); //michael ML + esp_wifi_set_appie_internal(WIFI_APPIE_WPA, hapd->wpa_auth->wpa_ie, (uint16_t)hapd->wpa_auth->wpa_ie_len, 0); os_free(auth_conf); return (void *)hapd; @@ -130,5 +130,7 @@ bool hostap_deinit(void *data) os_free(hapd); } + esp_wifi_unset_appie_internal(WIFI_APPIE_WPA); + return true; }