]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Invoke tear_down when exiting test_encode_tls_sct() prematurely
authorshridhar kalavagunta <coolshrid@hotmail.com>
Sun, 21 Apr 2024 23:48:33 +0000 (18:48 -0500)
committerTomas Mraz <tomas@openssl.org>
Tue, 23 Apr 2024 09:33:42 +0000 (11:33 +0200)
Fixes #24121

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24222)

test/ct_test.c

index 26d5bc1084503d4378c39be41850bcfdc8223a62..7bf4e940296c8e31b982767c0089cdc8478ca916 100644 (file)
@@ -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;