From: Jouni Malinen Date: Wed, 6 Mar 2019 22:27:12 +0000 (+0200) Subject: EAP-pwd: Fix a memory leak in hunting-and-pecking loop X-Git-Tag: hostap_2_8~273 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fda7660106a8b700a29b3e653dd25e96572b3aa7;p=thirdparty%2Fhostap.git 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 --- 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;