From b09b8a0ccce7d714dac741223917dfda1744f725 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Mon, 26 Oct 2009 09:55:46 +0000 Subject: [PATCH] Tiny code size improvement using goto instead of duplicating code --- src/core/dhcp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/dhcp.c b/src/core/dhcp.c index a6fd3e60..0246c87b 100644 --- a/src/core/dhcp.c +++ b/src/core/dhcp.c @@ -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.