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 <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2019-03-07 00:27:12 +02:00 committed by Jouni Malinen
parent dc0f727c99
commit fda7660106

View file

@ -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;