From 0487967153aca5eb83c12578a2d27648b9f69d95 Mon Sep 17 00:00:00 2001 From: Ilan Peer Date: Wed, 3 Apr 2019 15:16:15 +0300 Subject: [PATCH] OWE: Fix a possible memory leak on error path 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 --- wpa_supplicant/wpa_supplicant.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index a34e02201..57d3f126d 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -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 */