mirror of https://github.com/wolfSSL/wolfssl
Fix possible AES leaks detected with sanitizer and clang-tidy.
This commit is contained in:
parent
b9de3bbf1a
commit
59389a0ef5
|
@ -14060,11 +14060,16 @@ static WARN_UNUSED_RESULT int AesSivCipher(
|
|||
}
|
||||
}
|
||||
|
||||
aes->isAllocated = 0;
|
||||
wc_AesFree(aes);
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
XFREE(aes, NULL, DYNAMIC_TYPE_AES);
|
||||
if (aes != NULL)
|
||||
#endif
|
||||
{
|
||||
aes->isAllocated = 0;
|
||||
wc_AesFree(aes);
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
XFREE(aes, NULL, DYNAMIC_TYPE_AES);
|
||||
#endif
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -15913,8 +15913,8 @@ static wc_test_ret_t aesccm_128_test(void)
|
|||
XMEMSET(p2, 0, sizeof(p2));
|
||||
XMEMSET(iv2, 0, sizeof(iv2));
|
||||
|
||||
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
|
||||
wc_AesFree(enc);
|
||||
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
|
||||
enc = wc_AesNew(HEAP_HINT, devId);
|
||||
if (enc == NULL)
|
||||
ERROR_OUT(WC_TEST_RET_ENC_EC(MEMORY_E), out);
|
||||
|
|
Loading…
Reference in New Issue