diff --git a/ctaocrypt/src/ecc.c b/ctaocrypt/src/ecc.c index 4f2edf278..bc6836f8a 100644 --- a/ctaocrypt/src/ecc.c +++ b/ctaocrypt/src/ecc.c @@ -2338,6 +2338,8 @@ int ecc_import_x963(const byte* in, word32 inLen, ecc_key* key) } } + mp_clear(&a); + mp_clear(&b); mp_clear(&prime); mp_clear(&t2); mp_clear(&t1); diff --git a/ctaocrypt/test/test.c b/ctaocrypt/test/test.c index 35a59f7e1..59b16db3e 100644 --- a/ctaocrypt/test/test.c +++ b/ctaocrypt/test/test.c @@ -4584,6 +4584,7 @@ int ecc_test(void) for (i = 0; i < times; i++) { + ecc_free(&userA); ecc_init(&userA); memset(sig, 0, sizeof(sig)); @@ -4612,13 +4613,12 @@ int ecc_test(void) if (verify != 1) return -1023 - i; - - ecc_free(&userA); } } ecc_free(&pubKey); ecc_free(&userB); + ecc_free(&userA); return 0; }