[PATCH] eap: Fix possible memory leak in eap_leap_process_request()

Andrei Otcheretianski andrei.otcheretianski at intel.com
Thu Jun 8 01:17:57 PDT 2017


From: Ilan Peer <ilan.peer at intel.com>

Free 'resp' object in case of failure to derive response.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 src/eap_peer/eap_leap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/eap_peer/eap_leap.c b/src/eap_peer/eap_leap.c
index 7bb62e7..233b9ee 100644
--- a/src/eap_peer/eap_leap.c
+++ b/src/eap_peer/eap_leap.c
@@ -120,6 +120,7 @@ static struct wpabuf * eap_leap_process_request(struct eap_sm *sm, void *priv,
 	     nt_challenge_response(challenge, password, password_len, rpos))) {
 		wpa_printf(MSG_DEBUG, "EAP-LEAP: Failed to derive response");
 		ret->ignore = TRUE;
+		wpabuf_free(resp);
 		return NULL;
 	}
 	os_memcpy(data->peer_response, rpos, LEAP_RESPONSE_LEN);
-- 
1.9.1




More information about the Hostap mailing list