fixed bug #24480 (releasing old udp_pdb and pbuf in dhcp_start)

This commit is contained in:
goldsimon 2009-02-11 20:27:00 +00:00
parent f9bd5019fa
commit 6472e3b35e
2 changed files with 14 additions and 7 deletions

View File

@ -60,6 +60,9 @@ HISTORY
++ Bugfixes:
2009-02-11 Simon Goldschmidt
* dhcp.c: fixed bug #24480 (releasing old udp_pdb and pbuf in dhcp_start)
2009-02-11 Simon Goldschmidt
* opt.h, api_msg.c: added configurable default valud for netconn->recv_bufsize:
RECV_BUFSIZE_DEFAULT (fixes bug #23726: pbuf pool exhaustion on slow recv())

View File

@ -586,6 +586,12 @@ dhcp_start(struct netif *netif)
/* already has DHCP client attached */
} else {
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | 3, ("dhcp_start(): restarting DHCP configuration\n"));
if (dhcp->pcb != NULL) {
udp_remove(dhcp->pcb);
}
if (dhcp->p != NULL) {
pbuf_free(dhcp->p);
}
}
/* clear data structure */
@ -671,14 +677,12 @@ dhcp_inform(struct netif *netif)
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_inform: could not allocate DHCP request\n"));
}
if (dhcp != NULL) {
if (dhcp->pcb != NULL) {
udp_remove(dhcp->pcb);
}
dhcp->pcb = NULL;
mem_free((void *)dhcp);
netif->dhcp = old_dhcp;
if (dhcp->pcb != NULL) {
udp_remove(dhcp->pcb);
}
dhcp->pcb = NULL;
mem_free((void *)dhcp);
netif->dhcp = old_dhcp;
}
#if DHCP_DOES_ARP_CHECK