From: Jouni Malinen Date: Sat, 8 Jul 2017 13:21:01 +0000 (+0300) Subject: EAP-TTLS: Fix a memory leak on error paths X-Git-Tag: hostap_2_7~1195 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f2ae8cff5dba42fd6514485315043a6684ea049;p=thirdparty%2Fhostap.git EAP-TTLS: Fix a memory leak on error paths The allocated challenge needs to be freed on these error paths as well. Signed-off-by: Jouni Malinen --- diff --git a/src/eap_peer/eap_ttls.c b/src/eap_peer/eap_ttls.c index c8a05fdca..f18788ce8 100644 --- a/src/eap_peer/eap_ttls.c +++ b/src/eap_peer/eap_ttls.c @@ -629,6 +629,7 @@ static int eap_ttls_phase2_request_mschap(struct eap_sm *sm, wpa_printf(MSG_ERROR, "EAP-TTLS/MSCHAP: Failed derive password hash"); wpabuf_free(msg); + os_free(challenge); return -1; } @@ -641,6 +642,7 @@ static int eap_ttls_phase2_request_mschap(struct eap_sm *sm, wpa_printf(MSG_ERROR, "EAP-TTLS/MSCHAP: Failed derive password"); wpabuf_free(msg); + os_free(challenge); return -1; }