From fda7660106a8b700a29b3e653dd25e96572b3aa7 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 7 Mar 2019 00:27:12 +0200 Subject: [PATCH] EAP-pwd: Fix a memory leak in hunting-and-pecking loop tmp2 (y^2) was derived once in each iteration of the loop and only freed after all the loop iterations. Fix this by freeing the temporary value during each iteration. Signed-off-by: Jouni Malinen --- src/eap_common/eap_pwd_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/eap_common/eap_pwd_common.c b/src/eap_common/eap_pwd_common.c index 88c659588..02fe01e9f 100644 --- a/src/eap_common/eap_pwd_common.c +++ b/src/eap_common/eap_pwd_common.c @@ -238,6 +238,7 @@ int compute_password_element(EAP_PWD_group *grp, u16 num, * * y^2 = x^3 + ax + b */ + crypto_bignum_deinit(tmp2, 1); tmp2 = crypto_ec_point_compute_y_sqr(grp->group, x_candidate); if (!tmp2) goto fail;