forked from wolfSSL/wolfssl
Merge pull request #3762 from guidovranken/zd11732
Fix memory leak in fp_gcd
This commit is contained in:
@@ -5279,6 +5279,9 @@ int fp_gcd(fp_int *a, fp_int *b, fp_int *c)
|
|||||||
while (fp_iszero(v) == FP_NO) {
|
while (fp_iszero(v) == FP_NO) {
|
||||||
int err = fp_mod(u, v, r);
|
int err = fp_mod(u, v, r);
|
||||||
if (err != MP_OKAY) {
|
if (err != MP_OKAY) {
|
||||||
|
#ifdef WOLFSSL_SMALL_STACK
|
||||||
|
XFREE(u, NULL, DYNAMIC_TYPE_BIGINT);
|
||||||
|
#endif
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
fp_copy(v, u);
|
fp_copy(v, u);
|
||||||
|
Reference in New Issue
Block a user