]> granicus.if.org Git - esp-idf/commitdiff
dhcpserver: Fix crash when switching wifi mode
authorXu Chun Guang <xuchunguang@espressif.com>
Wed, 14 Sep 2016 08:14:50 +0000 (16:14 +0800)
committerXu Chun Guang <xuchunguang@espressif.com>
Wed, 14 Sep 2016 08:14:50 +0000 (16:14 +0800)
See Teamwork 7058.

components/lwip/apps/dhcpserver.c

index ca0592c917742df5f5b9ada0daa94ef9ecb03dd2..4cdef4123df788f0e9ae9acbc445e4d70ef0b0df 100644 (file)
@@ -1070,9 +1070,8 @@ void dhcps_stop(struct netif *netif)
         return;
     }
 
-    udp_disconnect(pcb_dhcps);
-
     if (apnetif->dhcps_pcb != NULL) {
+        udp_disconnect(apnetif->dhcps_pcb);
         udp_remove(apnetif->dhcps_pcb);
         apnetif->dhcps_pcb = NULL;
     }