aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_server
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-04-05 21:19:26 (GMT)
committerJouni Malinen <j@w1.fi>2014-04-05 21:34:30 (GMT)
commit48f668eecfb38a62743e22e0508b6a73cc102b29 (patch)
tree9f5e7a712bb1dd34c4f5d405a79b8dfc98740f89 /src/eap_server
parent4fc412ae76ec5e51f8843e06cbcdac650b326db8 (diff)
downloadhostap-48f668eecfb38a62743e22e0508b6a73cc102b29.zip
hostap-48f668eecfb38a62743e22e0508b6a73cc102b29.tar.gz
hostap-48f668eecfb38a62743e22e0508b6a73cc102b29.tar.bz2
EAP-pwd: Fix memory leak on error path with fragmentation
If fragmentation is used, the temporary inbuf/outbuf could have been leaked in error cases (e.g., reaching maximum number of roundtrips). Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/eap_server')
-rw-r--r--src/eap_server/eap_server_pwd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/eap_server/eap_server_pwd.c b/src/eap_server/eap_server_pwd.c
index b61061b..3467dd1 100644
--- a/src/eap_server/eap_server_pwd.c
+++ b/src/eap_server/eap_server_pwd.c
@@ -150,6 +150,8 @@ static void eap_pwd_reset(struct eap_sm *sm, void *priv)
BN_free(data->grp->prime);
os_free(data->grp);
}
+ wpabuf_free(data->inbuf);
+ wpabuf_free(data->outbuf);
os_free(data);
}
@@ -523,6 +525,7 @@ eap_pwd_build_req(struct eap_sm *sm, void *priv, u8 id)
*/
if (data->out_frag_pos >= wpabuf_len(data->outbuf)) {
wpabuf_free(data->outbuf);
+ data->outbuf = NULL;
data->out_frag_pos = 0;
}
@@ -949,6 +952,7 @@ static void eap_pwd_process(struct eap_sm *sm, void *priv,
*/
if (data->in_frag_pos) {
wpabuf_free(data->inbuf);
+ data->inbuf = NULL;
data->in_frag_pos = 0;
}
}