Fix heap hint usage in wc_RNG_HealthTest

Pass provided heap hint to XMALLOC instead of NULL in RNG health test
function to ensure proper memory allocation with custom heap.
This commit is contained in:
Reda Chouk
2025-01-02 12:35:52 +01:00
parent 239b85c804
commit d491e54c98

View File

@ -2184,7 +2184,7 @@ static int wc_RNG_HealthTestLocal(int reseed, void* heap, int devId)
#endif #endif
#ifdef WOLFSSL_SMALL_STACK #ifdef WOLFSSL_SMALL_STACK
check = (byte*)XMALLOC(RNG_HEALTH_TEST_CHECK_SIZE, NULL, check = (byte*)XMALLOC(RNG_HEALTH_TEST_CHECK_SIZE, heap,
DYNAMIC_TYPE_TMP_BUFFER); DYNAMIC_TYPE_TMP_BUFFER);
if (check == NULL) { if (check == NULL) {
return MEMORY_E; return MEMORY_E;
@ -2304,7 +2304,7 @@ static int wc_RNG_HealthTestLocal(int reseed, void* heap, int devId)
} }
#ifdef WOLFSSL_SMALL_STACK #ifdef WOLFSSL_SMALL_STACK
XFREE(check, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(check, heap, DYNAMIC_TYPE_TMP_BUFFER);
#endif #endif
return ret; return ret;