Skip to content

Commit 7ab29a8

Browse files
committed
Merge branch 'fix/esp_netif_minor_leak' into 'master'
Fix tiny memory leak when PPP connection creation fails in esp_netif_new_ppp (GitHub PR) Closes IDFGH-16327 See merge request espressif/esp-idf!42126
2 parents 747c172 + 4c7a215 commit 7ab29a8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

components/esp_netif/lwip/esp_netif_lwip_ppp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ netif_related_data_t * esp_netif_new_ppp(esp_netif_t *esp_netif, const esp_netif
229229
ESP_LOGD(TAG, "%s: PPP connection created: %p", __func__, ppp_obj->ppp);
230230
if (!ppp_obj->ppp) {
231231
ESP_LOGE(TAG, "%s: lwIP PPP connection cannot be created", __func__);
232+
free(ppp_obj);
232233
return NULL;
233234
}
234235

0 commit comments

Comments
 (0)