aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer/eap_sim.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-11-28 17:43:55 (GMT)
committerJouni Malinen <j@w1.fi>2015-11-28 18:46:36 (GMT)
commitea52a46e1313d67f85fd21952f353d8dbb2a5ca0 (patch)
tree9652af8e63f019adfe046210f0eb61a94288633d /src/eap_peer/eap_sim.c
parent1a33c94ccc49fad336d99ed3b61d4ffc0f5809be (diff)
downloadhostap-ea52a46e1313d67f85fd21952f353d8dbb2a5ca0.zip
hostap-ea52a46e1313d67f85fd21952f353d8dbb2a5ca0.tar.gz
hostap-ea52a46e1313d67f85fd21952f353d8dbb2a5ca0.tar.bz2
EAP-SIM peer: Fix memory leak on reauth error path
If init_for_reauth fails, the EAP-SIM peer state was not freed properly. Use eap_sim_deinit() to make sure all allocations get freed. This could be hit only if no random data could be derived for NONCE_MT. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/eap_peer/eap_sim.c')
-rw-r--r--src/eap_peer/eap_sim.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/eap_peer/eap_sim.c b/src/eap_peer/eap_sim.c
index 99a2816..cbf7461 100644
--- a/src/eap_peer/eap_sim.c
+++ b/src/eap_peer/eap_sim.c
@@ -1135,7 +1135,7 @@ static void * eap_sim_init_for_reauth(struct eap_sm *sm, void *priv)
if (random_get_bytes(data->nonce_mt, EAP_SIM_NONCE_MT_LEN)) {
wpa_printf(MSG_WARNING, "EAP-SIM: Failed to get random data "
"for NONCE_MT");
- os_free(data);
+ eap_sim_deinit(sm, data);
return NULL;
}
data->num_id_req = 0;