From 54d193743395578f0ac53dd818d4e5eab26a9cc7 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 21 Oct 2019 15:57:51 +0200 Subject: [PATCH] Fix memory leak in some SE HAL tests --- tests/suites/test_suite_psa_crypto_se_driver_hal.function | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/suites/test_suite_psa_crypto_se_driver_hal.function b/tests/suites/test_suite_psa_crypto_se_driver_hal.function index 61fb91805..e06ef1791 100644 --- a/tests/suites/test_suite_psa_crypto_se_driver_hal.function +++ b/tests/suites/test_suite_psa_crypto_se_driver_hal.function @@ -565,16 +565,17 @@ static int check_persistent_data( psa_key_lifetime_t lifetime, psa_storage_uid_t uid = file_uid_for_lifetime( lifetime ); struct psa_storage_info_t info; uint8_t *loaded = NULL; + int ok = 0; PSA_ASSERT( psa_its_get_info( uid, &info ) ); ASSERT_ALLOC( loaded, info.size ); PSA_ASSERT( psa_its_get( uid, 0, info.size, loaded, NULL ) ); ASSERT_COMPARE( expected_data, size, loaded, info.size ); - return( 1 ); + ok = 1; exit: mbedtls_free( loaded ); - return( 0 ); + return( ok ); } /* Check that a function's return status is "smoke-free", i.e. that