aboutsummaryrefslogtreecommitdiffstats
path: root/src/crypto/dh_group5.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-11-29 18:53:20 (GMT)
committerJouni Malinen <j@w1.fi>2015-11-29 18:53:20 (GMT)
commit4104267e81b0a0acdb43f693a67f236b3237a719 (patch)
treeccb6ada088b25f18754e48532ba75dce63f06ea1 /src/crypto/dh_group5.c
parentc5ef7bbfa526df9cd31c9befd001cf1b2af2b2c1 (diff)
downloadhostap-4104267e81b0a0acdb43f693a67f236b3237a719.zip
hostap-4104267e81b0a0acdb43f693a67f236b3237a719.tar.gz
hostap-4104267e81b0a0acdb43f693a67f236b3237a719.tar.bz2
Fix memory leak on NFC DH generation error path
It was possible for some NFC DH generation error paths to leak memory since the old private/public key was not freed if an allocation failed. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/crypto/dh_group5.c')
-rw-r--r--src/crypto/dh_group5.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/crypto/dh_group5.c b/src/crypto/dh_group5.c
index ccdbfc8..425c848 100644
--- a/src/crypto/dh_group5.c
+++ b/src/crypto/dh_group5.c
@@ -15,6 +15,7 @@
void * dh5_init(struct wpabuf **priv, struct wpabuf **publ)
{
+ wpabuf_free(*publ);
*publ = dh_init(dh_groups_get(5), priv);
if (*publ == NULL)
return NULL;