From: Ilan Peer Date: Wed, 3 Apr 2019 12:16:15 +0000 (+0300) Subject: OWE: Fix a possible memory leak on error path X-Git-Tag: hostap_2_8~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0487967153aca5eb83c12578a2d27648b9f69d95;p=thirdparty%2Fhostap.git 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 --- 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 */