ethernetif: fix potential memory leak

1. If L2_TO_L3_RX_BUF_MODE is not selected, we must assign l2_owner explictly before we call pbuf_free.
2. free intr resource in esp_eth_deinit

Closes https://github.com/espressif/esp-idf/issues/2670
This commit is contained in:
morris
2018-11-06 19:10:01 +08:00
parent beada90b06
commit 5fccb73f86
3 changed files with 53 additions and 5 deletions
@@ -196,7 +196,6 @@ if (netif->input(p, netif) != ERR_OK) {
/* full packet send to tcpip_thread to process */
if (netif->input(p, netif) != ERR_OK) {
LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
p->l2_owner = NULL;
pbuf_free(p);
}
#endif