From 94ef124f726e216648670c6319fd227fdb2691dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20H=C3=A4rdeman?= Date: Mon, 1 Dec 2025 08:37:32 +0100 Subject: [PATCH] dhcpv6-ia: fix crash in dhcpv6_free_lease() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Note that dhcpv6_free_lease() can be called with a NULL argument e.g. from dhcpv6_ia_handle_IAs() when iface->no_dynamic_dhcp is set and a client without a static lease cfg tries to get a dynamic lease. Closes: #321 Signed-off-by: David Härdeman Link: https://github.com/openwrt/odhcpd/pull/335 Signed-off-by: Álvaro Fernández Rojas --- src/dhcpv6-ia.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index f227ad6..5af952d 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -60,6 +60,9 @@ dhcpv6_alloc_lease(size_t extra_len) void dhcpv6_free_lease(struct dhcpv6_lease *a) { + if (!a) + return; + list_del(&a->head); list_del(&a->lease_cfg_list); -- 2.30.2