From 4599f551dead9eac233b91c0b9ee5879f5d0620a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 9 Jun 2025 08:44:23 +0200 Subject: [PATCH] dhcp: Clear flags Do not assume that mem_malloc() returns cleared memory. --- src/core/ipv4/dhcp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/ipv4/dhcp.c b/src/core/ipv4/dhcp.c index c149dd12..5c401368 100644 --- a/src/core/ipv4/dhcp.c +++ b/src/core/ipv4/dhcp.c @@ -831,6 +831,8 @@ dhcp_start(struct netif *netif) return ERR_MEM; } + /* clear the flags, the rest is cleared below */ + dhcp->flags = 0; /* store this dhcp client in the netif */ netif_set_client_data(netif, LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, dhcp); LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_start(): allocated dhcp\n"));