]> granicus.if.org Git - esp-idf/commitdiff
ethernetif: fix potential memory leak
authormorris <maoshengrong@espressif.com>
Tue, 6 Nov 2018 11:10:01 +0000 (19:10 +0800)
committermorris <maoshengrong@espressif.com>
Tue, 13 Nov 2018 03:41:17 +0000 (11:41 +0800)
1. If L2_TO_L3_RX_BUF_MODE is not selected, we must assign l2_owner explictly before we call pbuf_free.

components/lwip/port/netif/ethernetif.c

index 9189c03a91751d13283363af33181711170b9eaa..e7711ef0b36b5030752a48598673e85af9675869 100644 (file)
@@ -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