From 0b986713855cb154d3bf84cbd46b735aecb1985d Mon Sep 17 00:00:00 2001 From: aditi_lonkar Date: Tue, 28 Dec 2021 11:37:23 +0530 Subject: [PATCH] esp_wifi: Fixes memory leak in wpa3 connection. --- components/wpa_supplicant/src/common/sae.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/wpa_supplicant/src/common/sae.c b/components/wpa_supplicant/src/common/sae.c index 7575fa2770..65f24af06a 100644 --- a/components/wpa_supplicant/src/common/sae.c +++ b/components/wpa_supplicant/src/common/sae.c @@ -48,6 +48,7 @@ int sae_set_group(struct sae_data *sae, int group) tmp->prime_len = tmp->dh->prime_len; if (tmp->prime_len > SAE_MAX_PRIME_LEN) { sae_clear_data(sae); + os_free(tmp); return ESP_FAIL; } @@ -55,6 +56,7 @@ int sae_set_group(struct sae_data *sae, int group) tmp->prime_len); if (tmp->prime_buf == NULL) { sae_clear_data(sae); + os_free(tmp); return ESP_FAIL; } tmp->prime = tmp->prime_buf; @@ -63,6 +65,7 @@ int sae_set_group(struct sae_data *sae, int group) tmp->dh->order_len); if (tmp->order_buf == NULL) { sae_clear_data(sae); + os_free(tmp); return ESP_FAIL; } tmp->order = tmp->order_buf; @@ -73,6 +76,7 @@ int sae_set_group(struct sae_data *sae, int group) /* Unsupported group */ wpa_printf(MSG_DEBUG, "SAE: Group %d not supported by the crypto library", group); + os_free(tmp); return ESP_FAIL; }