Use ASSERT_ALLOC
Change the calloc functions to ASSERT_ALLOC to check the
return value of calloc as well.
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
diff --git a/tests/suites/test_suite_hkdf.function b/tests/suites/test_suite_hkdf.function
index 6cb1118..feb1717 100644
--- a/tests/suites/test_suite_hkdf.function
+++ b/tests/suites/test_suite_hkdf.function
@@ -78,7 +78,7 @@
const mbedtls_md_info_t *md = mbedtls_md_info_from_type( md_alg );
TEST_ASSERT( md != NULL );
- output_okm = mbedtls_calloc( OKM_LEN, 1 );
+ ASSERT_ALLOC( output_okm, OKM_LEN );
prk = mbedtls_test_unhexify_alloc( hex_prk_string, &prk_len );
info = mbedtls_test_unhexify_alloc( hex_info_string, &info_len );
@@ -143,10 +143,10 @@
info_len = 0;
if (prk_len > 0)
- prk = mbedtls_calloc( prk_len, 1 );
+ ASSERT_ALLOC( prk, prk_len );
if (okm_len > 0)
- okm = mbedtls_calloc( okm_len, 1 );
+ ASSERT_ALLOC( okm, okm_len );
output_ret = mbedtls_hkdf_expand( &fake_md_info, prk, prk_len,
info, info_len, okm, okm_len );