From 7c5442e744e7188e691f41f7c543d5a37dbb16d1 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 6 Mar 2021 11:56:00 +0200 Subject: [PATCH] DPP: Clear hapd->gas pointer on deinit While it does not look like the stale pointer could have been dereferenced in practice, it is better not to leave the stale pointer to freed memory in place to avoid accidental uses. Signed-off-by: Jouni Malinen --- src/ap/hostapd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 8892a7a0c..7bb0f0976 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -392,6 +392,7 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd) #ifdef CONFIG_DPP hostapd_dpp_deinit(hapd); gas_query_ap_deinit(hapd->gas); + hapd->gas = NULL; #endif /* CONFIG_DPP */ authsrv_deinit(hapd);