Skip to content

Commit 4599f55

Browse files
sebhubyarrick
authored andcommitted
dhcp: Clear flags
Do not assume that mem_malloc() returns cleared memory.
1 parent 41a3609 commit 4599f55

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/core/ipv4/dhcp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -831,6 +831,8 @@ dhcp_start(struct netif *netif)
831831
return ERR_MEM;
832832
}
833833

834+
/* clear the flags, the rest is cleared below */
835+
dhcp->flags = 0;
834836
/* store this dhcp client in the netif */
835837
netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, dhcp);
836838
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): allocated dhcp\n"));

0 commit comments

Comments
 (0)