Release DHCP structure memory when netif is down.

This commit is contained in:
XiaXiaotian 2017-10-12 17:03:44 +08:00
parent 3a4bd7f16c
commit ad1350f0ac

View file

@ -369,6 +369,14 @@ netif_remove(struct netif *netif)
netif_set_down(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); mib2_remove_ip4(netif);
/* this netif is default? */ /* this netif is default? */