From ae1fb645509322e8503d22dcede6ea8168dd327a Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 17 Apr 2022 23:37:50 +0300 Subject: [PATCH] EAP-EKE server: Fix a memory leak on an error path The allocated Response/Commit message was not freed if DH initialization failed. Signed-off-by: Jouni Malinen --- src/eap_server/eap_server_eke.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/eap_server/eap_server_eke.c b/src/eap_server/eap_server_eke.c index eac3245cd..544067076 100644 --- a/src/eap_server/eap_server_eke.c +++ b/src/eap_server/eap_server_eke.c @@ -276,6 +276,7 @@ static struct wpabuf * eap_eke_build_commit(struct eap_sm *sm, if (eap_eke_dh_init(data->sess.dhgroup, data->dh_priv, pub) < 0) { wpa_printf(MSG_INFO, "EAP-EKE: Failed to initialize DH"); + wpabuf_free(msg); eap_eke_fail(data, EAP_EKE_FAIL_PRIVATE_INTERNAL_ERROR); return eap_eke_build_failure(data, id); }