From ef67d38bc0a7c610f021154ef296207b4ea1bc6e Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Mon, 31 Oct 2022 15:11:49 +0000 Subject: [PATCH] Fix memory leak in mpi_core_ct_uint_table_lookup test Signed-off-by: Janos Follath --- tests/suites/test_suite_bignum_core.function | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/suites/test_suite_bignum_core.function b/tests/suites/test_suite_bignum_core.function index f4fd51c160..c0bee70d26 100644 --- a/tests/suites/test_suite_bignum_core.function +++ b/tests/suites/test_suite_bignum_core.function @@ -949,9 +949,9 @@ void mpi_core_ct_uint_table_lookup( int bitlen, int window_size ) size_t count = ( (size_t) 1 ) << window_size; mbedtls_mpi_uint *table = NULL; - ASSERT_ALLOC( table, limbs * count ); - mbedtls_mpi_uint *dest = NULL; + + ASSERT_ALLOC( table, limbs * count ); ASSERT_ALLOC( dest, limbs ); /* @@ -986,6 +986,7 @@ void mpi_core_ct_uint_table_lookup( int bitlen, int window_size ) } exit: - ; + mbedtls_free(table); + mbedtls_free(dest); } /* END_CASE */