aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer/eap_pwd.c
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_peer/eap_pwd.c
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_peer/eap_pwd.c')
-rw-r--r--src/eap_peer/eap_pwd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/eap_peer/eap_pwd.c b/src/eap_peer/eap_pwd.c
index fef4783..9eb058e 100644
--- a/src/eap_peer/eap_pwd.c
+++ b/src/eap_peer/eap_pwd.c
@@ -161,6 +161,8 @@ static void eap_pwd_deinit(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);
}
@@ -773,6 +775,7 @@ eap_pwd_process(struct eap_sm *sm, void *priv, struct eap_method_ret *ret,
(int) data->in_frag_pos,
(int) wpabuf_len(data->inbuf));
wpabuf_free(data->inbuf);
+ data->inbuf = NULL;
data->in_frag_pos = 0;
return NULL;
}
@@ -824,6 +827,7 @@ eap_pwd_process(struct eap_sm *sm, void *priv, struct eap_method_ret *ret,
*/
if (data->in_frag_pos) {
wpabuf_free(data->inbuf);
+ data->inbuf = NULL;
data->in_frag_pos = 0;
}