[PATCH 4/6] DPP: fix memleak of intro.peer_key

Glenn Strauss gstrauss at gluelogic.com
Mon Nov 7 21:05:52 PST 2022


fix memleak of intro.peer_key in wpas_dpp_rx_peer_disc_resp()

Signed-off-by: Glenn Strauss <gstrauss at gluelogic.com>
---
 wpa_supplicant/dpp_supplicant.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c
index 10b1301a8..d0b967aba 100644
--- a/wpa_supplicant/dpp_supplicant.c
+++ b/wpa_supplicant/dpp_supplicant.c
@@ -2624,6 +2624,8 @@ static void wpas_dpp_rx_peer_disc_resp(struct wpa_supplicant *wpa_s,
 		return;
 	}
 
+	os_memset(&intro, 0, sizeof(intro));
+
 	trans_id = dpp_get_attr(buf, len, DPP_ATTR_TRANSACTION_ID,
 			       &trans_id_len);
 	if (!trans_id || trans_id_len != 1) {
@@ -2734,7 +2736,7 @@ static void wpas_dpp_rx_peer_disc_resp(struct wpa_supplicant *wpa_s,
 		wpa_supplicant_req_scan(wpa_s, 0, 0);
 	}
 fail:
-	os_memset(&intro, 0, sizeof(intro));
+	dpp_peer_intro_deinit(&intro);
 }
 
 
-- 
2.38.1



More information about the Hostap mailing list