mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-04 11:38:11 +00:00
Tiny code size improvement using goto instead of duplicating code
This commit is contained in:
parent
db259c3557
commit
b09b8a0ccc
@ -676,8 +676,7 @@ dhcp_inform(struct netif *netif)
|
||||
dhcp->pcb = udp_new();
|
||||
if (dhcp->pcb == NULL) {
|
||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_inform(): could not obtain pcb"));
|
||||
mem_free((void *)dhcp);
|
||||
return;
|
||||
goto free_dhcp_and_return;
|
||||
}
|
||||
old_dhcp = netif->dhcp;
|
||||
netif->dhcp = dhcp;
|
||||
@ -709,8 +708,9 @@ dhcp_inform(struct netif *netif)
|
||||
|
||||
udp_remove(dhcp->pcb);
|
||||
dhcp->pcb = NULL;
|
||||
mem_free((void *)dhcp);
|
||||
netif->dhcp = old_dhcp;
|
||||
free_dhcp_and_return:
|
||||
mem_free((void *)dhcp);
|
||||
}
|
||||
|
||||
/** Handle a possible change in the network configuration.
|
||||
|
Loading…
Reference in New Issue
Block a user