From 772b9986a181c8b2c40fc8143c8b7140ee593978 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 1 May 2024 18:55:24 +0200 Subject: [PATCH] AP: add missing null pointer check in hostapd_free_hapd_data When called from wpa_supplicant, iface->interfaces can be NULL Signed-off-by: Felix Fietkau --- src/ap/hostapd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 2c7dcc0ed..68034ccd1 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -485,7 +485,7 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd) struct hapd_interfaces *ifaces = hapd->iface->interfaces; size_t i; - for (i = 0; i < ifaces->count; i++) { + for (i = 0; ifaces && i < ifaces->count; i++) { struct hostapd_iface *iface = ifaces->iface[i]; size_t j;