aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2017-07-08 13:21:01 (GMT)
committerJouni Malinen <j@w1.fi>2017-07-08 13:21:38 (GMT)
commit1f2ae8cff5dba42fd6514485315043a6684ea049 (patch)
treeb56e570bae3f9ae230581868ff74b72b8c75c65e /src
parent83e003a9132a33921e8e284f07aeab1d72153131 (diff)
downloadhostap-1f2ae8cff5dba42fd6514485315043a6684ea049.zip
hostap-1f2ae8cff5dba42fd6514485315043a6684ea049.tar.gz
hostap-1f2ae8cff5dba42fd6514485315043a6684ea049.tar.bz2
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 <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/eap_peer/eap_ttls.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/eap_peer/eap_ttls.c b/src/eap_peer/eap_ttls.c
index c8a05fd..f18788c 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;
}