]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FILS: Fix memory leak if AES-SIV encryption fails
authorBenjamin Berg <benjamin.berg@intel.com>
Thu, 22 Jan 2026 15:21:48 +0000 (16:21 +0100)
committerJouni Malinen <j@w1.fi>
Sat, 24 Jan 2026 17:02:53 +0000 (19:02 +0200)
The dynamically allocated header was not free'ed in the error path. Add
the appropriate os_free call.

Fixes: b729fd8df9f6 ("FILS: Use AEAD cipher to protect EAPOL-Key frames (AP)")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
src/ap/wpa_auth.c

index f4319f394331aac8d8049d23cf71994400d4f1c3..75c265a5b4e7f2bc7d6449ec3af3d7ed9ff6e34b 100644 (file)
@@ -2186,6 +2186,7 @@ void __wpa_send_eapol(struct wpa_authenticator *wpa_auth,
                if (aes_siv_encrypt(sm->PTK.kek, sm->PTK.kek_len, kde, kde_len,
                                    1, aad, aad_len, key_mic + 2) < 0) {
                        wpa_printf(MSG_DEBUG, "WPA: AES-SIV encryption failed");
+                       os_free(hdr);
                        return;
                }