From da8835aa0b6b4102053825938d6c8134a4f5d52f Mon Sep 17 00:00:00 2001 From: morris Date: Tue, 6 Nov 2018 19:10:01 +0800 Subject: [PATCH] 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. --- components/lwip/port/netif/ethernetif.c | 1 - 1 file changed, 1 deletion(-) diff --git a/components/lwip/port/netif/ethernetif.c b/components/lwip/port/netif/ethernetif.c index 9189c03a9..e7711ef0b 100644 --- a/components/lwip/port/netif/ethernetif.c +++ b/components/lwip/port/netif/ethernetif.c @@ -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