From 69bd5a29d9c184652bb241de5d8388566bcbddb7 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sat, 12 Jun 2010 17:05:54 +0000 Subject: [PATCH] Fixed a possible NULL-pointer deref before checking it --- src/core/dhcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/dhcp.c b/src/core/dhcp.c index 05816f58..b0b3b80f 100644 --- a/src/core/dhcp.c +++ b/src/core/dhcp.c @@ -1206,8 +1206,9 @@ dhcp_release(struct netif *netif) void dhcp_stop(struct netif *netif) { - struct dhcp *dhcp = netif->dhcp; + struct dhcp *dhcp; LWIP_ERROR("dhcp_stop: netif != NULL", (netif != NULL), return;); + dhcp = netif->dhcp; /* Remove the flag that says this netif is handled by DHCP. */ netif->flags &= ~NETIF_FLAG_DHCP;