From c7b53747f724bfc674ebe2556d3dec8b93374a4a Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Wed, 3 Feb 2021 13:18:33 +0000 Subject: [PATCH] Fix for memory leak in ssl tests Fix for leaked buffers on error case in build_transforms() in test_suite_ssl.function Signed-off-by: Paul Elliott --- tests/suites/test_suite_ssl.function | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function index f377ffa99..d021cbd49 100644 --- a/tests/suites/test_suite_ssl.function +++ b/tests/suites/test_suite_ssl.function @@ -1354,7 +1354,8 @@ static int build_transforms( mbedtls_ssl_transform *t_in, t_in->taglen = 8; break; default: - return( 1 ); + ret = 1; + goto cleanup; } break; @@ -1374,7 +1375,8 @@ static int build_transforms( mbedtls_ssl_transform *t_in, t_in->taglen = 8; break; default: - return( 1 ); + ret = 1; + goto cleanup; } break; @@ -1395,11 +1397,13 @@ static int build_transforms( mbedtls_ssl_transform *t_in, t_in->maclen = 10; break; default: - return( 1 ); + ret = 1; + goto cleanup; } break; default: - return( 1 ); + ret = 1; + goto cleanup; break; }