From ad1350f0acee28f7458b4105d7af9eb6f30540f0 Mon Sep 17 00:00:00 2001 From: XiaXiaotian Date: Thu, 12 Oct 2017 17:03:44 +0800 Subject: [PATCH] Release DHCP structure memory when netif is down. --- components/lwip/core/netif.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/lwip/core/netif.c b/components/lwip/core/netif.c index f745f29ac..76e6f6132 100755 --- a/components/lwip/core/netif.c +++ b/components/lwip/core/netif.c @@ -369,6 +369,14 @@ netif_remove(struct netif *netif) netif_set_down(netif); } +#if LWIP_DHCP + /* netif not under DHCP control by default */ + if (netif->dhcp) { + free(netif->dhcp); + netif->dhcp = NULL; + } +#endif /* LWIP_DHCP */ + mib2_remove_ip4(netif); /* this netif is default? */