test/cmp_vfy_test.c: free before return
authorPeiwei Hu <jlu.hpw@foxmail.com>
Wed, 15 Dec 2021 09:29:49 +0000 (17:29 +0800)
committerTomas Mraz <tomas@openssl.org>
Fri, 17 Dec 2021 07:50:11 +0000 (08:50 +0100)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17279)

test/cmp_vfy_test.c

index a4800903637309920a3d1df136fd06970768a32f..5aa6a008ccbb0f84da48678368ca75a32219cd8c 100644 (file)
@@ -51,11 +51,13 @@ static time_t test_time_valid = 0, test_time_after_expiration = 0;
 
 static CMP_VFY_TEST_FIXTURE *set_up(const char *const test_case_name)
 {
-    X509_STORE *ts = X509_STORE_new();
+    X509_STORE *ts;
     CMP_VFY_TEST_FIXTURE *fixture;
 
     if (!TEST_ptr(fixture = OPENSSL_zalloc(sizeof(*fixture))))
         return NULL;
+
+    ts = X509_STORE_new();
     fixture->test_case_name = test_case_name;
     if (ts == NULL
             || !TEST_ptr(fixture->cmp_ctx = OSSL_CMP_CTX_new(libctx, NULL))