]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OWE: Fix a possible memory leak on error path
authorIlan Peer <ilan.peer@intel.com>
Wed, 3 Apr 2019 12:16:15 +0000 (15:16 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 6 Apr 2019 14:02:13 +0000 (17:02 +0300)
Properly handle the case where OWE IE is allocated, but
there is no space left to add it in the WPA IE buffer.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
wpa_supplicant/wpa_supplicant.c

index a34e022017c8516bca4c4ab2addd15767807928d..57d3f126dcc1e40093bfebcfaa4db5b6c8056644 100644 (file)
@@ -2846,8 +2846,8 @@ static u8 * wpas_populate_assoc_ies(
                        os_memcpy(wpa_ie + wpa_ie_len,
                                  wpabuf_head(owe_ie), wpabuf_len(owe_ie));
                        wpa_ie_len += wpabuf_len(owe_ie);
-                       wpabuf_free(owe_ie);
                }
+               wpabuf_free(owe_ie);
        }
 #endif /* CONFIG_OWE */