mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_wifi: Fixes memory leak in wpa3.
This commit is contained in:
parent
5b80dd44be
commit
7cd52401b0
@ -57,6 +57,7 @@ int sae_set_group(struct sae_data *sae, int group)
|
|||||||
tmp->prime_len = tmp->dh->prime_len;
|
tmp->prime_len = tmp->dh->prime_len;
|
||||||
if (tmp->prime_len > SAE_MAX_PRIME_LEN) {
|
if (tmp->prime_len > SAE_MAX_PRIME_LEN) {
|
||||||
sae_clear_data(sae);
|
sae_clear_data(sae);
|
||||||
|
os_free(tmp);
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,6 +65,7 @@ int sae_set_group(struct sae_data *sae, int group)
|
|||||||
tmp->prime_len);
|
tmp->prime_len);
|
||||||
if (tmp->prime_buf == NULL) {
|
if (tmp->prime_buf == NULL) {
|
||||||
sae_clear_data(sae);
|
sae_clear_data(sae);
|
||||||
|
os_free(tmp);
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
tmp->prime = tmp->prime_buf;
|
tmp->prime = tmp->prime_buf;
|
||||||
@ -72,6 +74,7 @@ int sae_set_group(struct sae_data *sae, int group)
|
|||||||
tmp->dh->order_len);
|
tmp->dh->order_len);
|
||||||
if (tmp->order_buf == NULL) {
|
if (tmp->order_buf == NULL) {
|
||||||
sae_clear_data(sae);
|
sae_clear_data(sae);
|
||||||
|
os_free(tmp);
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
tmp->order = tmp->order_buf;
|
tmp->order = tmp->order_buf;
|
||||||
@ -82,6 +85,7 @@ int sae_set_group(struct sae_data *sae, int group)
|
|||||||
/* Unsupported group */
|
/* Unsupported group */
|
||||||
wpa_printf(MSG_DEBUG,
|
wpa_printf(MSG_DEBUG,
|
||||||
"SAE: Group %d not supported by the crypto library", group);
|
"SAE: Group %d not supported by the crypto library", group);
|
||||||
|
os_free(tmp);
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user