Fix tiny memory leak when PPP connection creation fails in esp_netif_new_ppp

This commit is contained in:
Mastro Gippo
2025-08-21 14:44:39 +02:00
committed by GitHub
parent 758939caec
commit 4c7a2159c2

View File

@@ -229,6 +229,7 @@ netif_related_data_t * esp_netif_new_ppp(esp_netif_t *esp_netif, const esp_netif
ESP_LOGD(TAG, "%s: PPP connection created: %p", __func__, ppp_obj->ppp); ESP_LOGD(TAG, "%s: PPP connection created: %p", __func__, ppp_obj->ppp);
if (!ppp_obj->ppp) { if (!ppp_obj->ppp) {
ESP_LOGE(TAG, "%s: lwIP PPP connection cannot be created", __func__); ESP_LOGE(TAG, "%s: lwIP PPP connection cannot be created", __func__);
free(ppp_obj);
return NULL; return NULL;
} }