From 2f28c6b677ff9407663e272bf86df96afbe7555b Mon Sep 17 00:00:00 2001 From: JoeSubbiani Date: Fri, 18 Jun 2021 11:03:57 +0100 Subject: [PATCH] Free context at the end of aes_crypt_xts_size() in file tests/suite/test_suite_aes.function, aes_crypt_xts_size() did not free the context upon the function exit. The function now frees the context on exit. Already resolved for 2.x and development - this is a backport for 2.16 Fixes #4176 Signed-off-by: JoeSubbiani --- tests/suites/test_suite_aes.function | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/suites/test_suite_aes.function b/tests/suites/test_suite_aes.function index 23bf83d093..1b7e5dbb27 100644 --- a/tests/suites/test_suite_aes.function +++ b/tests/suites/test_suite_aes.function @@ -208,6 +208,8 @@ void aes_crypt_xts_size( int size, int retval ) /* Valid pointers are passed for builds with MBEDTLS_CHECK_PARAMS, as * otherwise we wouldn't get to the size check we're interested in. */ TEST_ASSERT( mbedtls_aes_crypt_xts( &ctx, MBEDTLS_AES_ENCRYPT, length, data_unit, src, output ) == retval ); +exit: + mbedtls_aes_xts_free( &ctx ); } /* END_CASE */