]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-EKE server: Fix a memory leak on an error path
authorJouni Malinen <j@w1.fi>
Sun, 17 Apr 2022 20:37:50 +0000 (23:37 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 17 Apr 2022 20:37:50 +0000 (23:37 +0300)
The allocated Response/Commit message was not freed if DH initialization
failed.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/eap_server/eap_server_eke.c

index eac3245cd1f296da81b8d77d142411a4c6cd95b5..544067076f04c2e9fe85e063a29b75e008044894 100644 (file)
@@ -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);
        }