From 8f56d0604c13626badf2ed1dd7ef6bf712c507d7 Mon Sep 17 00:00:00 2001 From: shridhar kalavagunta Date: Sun, 21 Apr 2024 18:48:33 -0500 Subject: [PATCH] Invoke tear_down when exiting test_encode_tls_sct() prematurely Fixes #24121 Reviewed-by: Matt Caswell Reviewed-by: Tom Cosgrove Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/24222) (cherry picked from commit 264ff64b9443e60c7c93af0ced2b22fdf622d179) --- test/ct_test.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/ct_test.c b/test/ct_test.c index 26d5bc1084503..7bf4e940296c8 100644 --- a/test/ct_test.c +++ b/test/ct_test.c @@ -450,13 +450,18 @@ static int test_encode_tls_sct(void) fixture->sct_list = sk_SCT_new_null(); if (fixture->sct_list == NULL) - return 0; + { + tear_down(fixture); + return 0; + } if (!TEST_ptr(sct = SCT_new_from_base64(SCT_VERSION_V1, log_id, CT_LOG_ENTRY_TYPE_X509, timestamp, extensions, signature))) - + { + tear_down(fixture); return 0; + } sk_SCT_push(fixture->sct_list, sct); fixture->sct_dir = ct_dir;