From 2fcdd7446e5c83cdb5170a5d4b4470d6f6c9050a Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Tue, 26 Feb 2019 13:59:48 +0000 Subject: [PATCH] Fix a memory leak in x509write test suite This leak wasn't discovered by the CI because the only test in all.sh exercising the respective path enabled the custom memory buffer allocator implementations of calloc() and free(), hence bypassing ASan. --- tests/suites/test_suite_x509write.function | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/suites/test_suite_x509write.function b/tests/suites/test_suite_x509write.function index e15802ff1..7a359b1c6 100644 --- a/tests/suites/test_suite_x509write.function +++ b/tests/suites/test_suite_x509write.function @@ -57,6 +57,7 @@ static int x509_crt_verifycsr( const unsigned char *buf, size_t buflen ) return( MBEDTLS_ERR_X509_CERT_VERIFY_FAILED ); } + mbedtls_x509_csr_free( &csr ); return( 0 ); } #endif /* MBEDTLS_USE_PSA_CRYPTO */