Fix wc_ecc_sign_hash memory leak. ZD 11556.

This commit is contained in:
Guido Vranken
2021-01-22 09:55:30 +01:00
parent 4b47bf7b4e
commit 905f0b1f5a

View File

@@ -5149,6 +5149,8 @@ int wc_ecc_sign_hash(const byte* in, word32 inlen, byte* out, word32 *outlen,
err = wc_ecc_sign_hash_ex(in, inlen, rng, key, r, s);
#endif
if (err < 0) {
mp_clear(r);
mp_clear(s);
#ifdef WOLFSSL_SMALL_STACK
XFREE(s, key->heap, DYNAMIC_TYPE_ECC);
XFREE(r, key->heap, DYNAMIC_TYPE_ECC);