aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_server/eap_server_psk.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2011-11-27 20:41:38 (GMT)
committerJouni Malinen <j@w1.fi>2011-11-27 20:41:38 (GMT)
commit864a8e3bf67e1c77702068cc14909b8d33cf032d (patch)
tree2e3a381e6263156e5937d9a7e1c9434696811221 /src/eap_server/eap_server_psk.c
parentcdc6e5d0840c9c44e47b63a6740ecb20c6fe6865 (diff)
downloadhostap-864a8e3bf67e1c77702068cc14909b8d33cf032d.zip
hostap-864a8e3bf67e1c77702068cc14909b8d33cf032d.tar.gz
hostap-864a8e3bf67e1c77702068cc14909b8d33cf032d.tar.bz2
EAP-PSK: Fix memory leak on error path
Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/eap_server/eap_server_psk.c')
-rw-r--r--src/eap_server/eap_server_psk.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/eap_server/eap_server_psk.c b/src/eap_server/eap_server_psk.c
index efc7a82..fb299ae 100644
--- a/src/eap_server/eap_server_psk.c
+++ b/src/eap_server/eap_server_psk.c
@@ -125,8 +125,10 @@ static struct wpabuf * eap_psk_build_3(struct eap_sm *sm,
os_memcpy(buf, data->id_s, data->id_s_len);
os_memcpy(buf + data->id_s_len, data->rand_p, EAP_PSK_RAND_LEN);
- if (omac1_aes_128(data->ak, buf, buflen, psk->mac_s))
+ if (omac1_aes_128(data->ak, buf, buflen, psk->mac_s)) {
+ os_free(buf);
goto fail;
+ }
os_free(buf);
if (eap_psk_derive_keys(data->kdk, data->rand_p, data->tek, data->msk,