forked from wolfSSL/wolfssl
Clear MP in ECC to free allocated memory
This commit is contained in:
committed by
John Safranek
parent
113753370d
commit
38b717eb42
@@ -2811,7 +2811,6 @@ static int ecc_point_to_mont(ecc_point* p, ecc_point* r, mp_int* modulus,
|
|||||||
err = mp_init(mu);
|
err = mp_init(mu);
|
||||||
if (err == MP_OKAY) {
|
if (err == MP_OKAY) {
|
||||||
err = mp_montgomery_calc_normalization(mu, modulus);
|
err = mp_montgomery_calc_normalization(mu, modulus);
|
||||||
}
|
|
||||||
|
|
||||||
if (err == MP_OKAY) {
|
if (err == MP_OKAY) {
|
||||||
if (mp_cmp_d(mu, 1) == MP_EQ) {
|
if (mp_cmp_d(mu, 1) == MP_EQ) {
|
||||||
@@ -2830,6 +2829,8 @@ static int ecc_point_to_mont(ecc_point* p, ecc_point* r, mp_int* modulus,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mp_clear(mu);
|
||||||
|
}
|
||||||
#ifdef WOLFSSL_SMALL_STACK
|
#ifdef WOLFSSL_SMALL_STACK
|
||||||
if (mu != NULL)
|
if (mu != NULL)
|
||||||
XFREE(mu, heap, DYNAMIC_TYPE_ECC);
|
XFREE(mu, heap, DYNAMIC_TYPE_ECC);
|
||||||
|
Reference in New Issue
Block a user