From 20d2e06ca48f4babeb7308ba5637e32ee8c4bcd2 Mon Sep 17 00:00:00 2001 From: Raef Coles Date: Thu, 13 Oct 2022 09:28:18 +0100 Subject: [PATCH] Add cleanup frees in LMS and LMOTS tests Signed-off-by: Raef Coles --- tests/suites/test_suite_lmots.function | 2 ++ tests/suites/test_suite_lms.function | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/tests/suites/test_suite_lmots.function b/tests/suites/test_suite_lmots.function index c582ce700..1fec900fc 100644 --- a/tests/suites/test_suite_lmots.function +++ b/tests/suites/test_suite_lmots.function @@ -142,6 +142,8 @@ void lmots_verify_test ( data_t *msg, data_t *sig, data_t *pub_key, } exit: + if( tmp_sig != NULL ) + mbedtls_free( tmp_sig ); mbedtls_lmots_public_free( &ctx ); } /* END_CASE */ diff --git a/tests/suites/test_suite_lms.function b/tests/suites/test_suite_lms.function index c0cf02cb8..b6ae30918 100644 --- a/tests/suites/test_suite_lms.function +++ b/tests/suites/test_suite_lms.function @@ -138,6 +138,8 @@ void lms_verify_test ( data_t * msg, data_t * sig, data_t * pub_key, } exit: + if( tmp_sig != NULL ) + mbedtls_free( tmp_sig ); mbedtls_lms_public_free( &ctx ); } /* END_CASE */ @@ -180,6 +182,8 @@ void lms_import_export_test ( data_t * pub_key, int expected_import_rc ) } exit: + if( exported_pub_key != NULL ) + mbedtls_free( exported_pub_key ); mbedtls_lms_public_free( &ctx ); } /* END_CASE */