aboutsummaryrefslogtreecommitdiffstats
path: root/src/eapol_supp
diff options
context:
space:
mode:
authorSrikanth Marepalli <srimarep@codeaurora.org>2018-09-20 07:56:07 (GMT)
committerJouni Malinen <j@w1.fi>2018-09-21 18:34:08 (GMT)
commitbd88ed60fa9e45c67aeab45a5b7bd6d536cbf14d (patch)
tree75a4e70c123da8617aab30873bd93ecb7628b905 /src/eapol_supp
parent820ea0ba934755bad1bdac3bca435312077906c3 (diff)
downloadhostap-bd88ed60fa9e45c67aeab45a5b7bd6d536cbf14d.zip
hostap-bd88ed60fa9e45c67aeab45a5b7bd6d536cbf14d.tar.gz
hostap-bd88ed60fa9e45c67aeab45a5b7bd6d536cbf14d.tar.bz2
eap_proxy: Fix memory leaks when using eap_peer_erp_init()
The external session_id and emsk from eap_proxy_get_eap_session_id() and eap_proxy_get_emsk() need to be freed consistently in all code paths within eap_peer_erp_init() and outside it in the case ERP is not initialized. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'src/eapol_supp')
-rw-r--r--src/eapol_supp/eapol_supp_sm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/eapol_supp/eapol_supp_sm.c b/src/eapol_supp/eapol_supp_sm.c
index bfbc995..9f029b0 100644
--- a/src/eapol_supp/eapol_supp_sm.c
+++ b/src/eapol_supp/eapol_supp_sm.c
@@ -503,10 +503,14 @@ SM_STATE(SUPP_BE, SUCCESS)
session_id = eap_proxy_get_eap_session_id(
sm->eap_proxy, &session_id_len);
emsk = eap_proxy_get_emsk(sm->eap_proxy, &emsk_len);
- if (sm->config->erp && session_id && emsk)
+ if (sm->config->erp && session_id && emsk) {
eap_peer_erp_init(sm->eap, session_id,
session_id_len, emsk,
emsk_len);
+ } else {
+ os_free(session_id);
+ bin_clear_free(emsk, emsk_len);
+ }
}
return;
}