mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Fix possible AES leaks detected with sanitizer and clang-tidy.
This commit is contained in:
@ -14060,11 +14060,16 @@ static WARN_UNUSED_RESULT int AesSivCipher(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
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);
|
||||
|
Reference in New Issue
Block a user