remove redundant free of NULL
authorPauli <pauli@openssl.org>
Mon, 4 Sep 2023 04:37:09 +0000 (14:37 +1000)
committerPauli <pauli@openssl.org>
Tue, 3 Oct 2023 07:54:03 +0000 (18:54 +1100)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22210)

providers/fips/fipsprov.c

index 518226dfc6e7d16e2ed151227217a0184982ba9d..0cd5e1bba26deafd2815a87009d7d762cb680a76 100644 (file)
@@ -691,15 +691,8 @@ int OSSL_provider_init_int(const OSSL_CORE_HANDLE *handle,
 
     /*  Create a context. */
     if ((*provctx = ossl_prov_ctx_new()) == NULL
-        || (libctx = OSSL_LIB_CTX_new()) == NULL) {
-        /*
-         * We free libctx separately here and only here because it hasn't
-         * been attached to *provctx.  All other error paths below rely
-         * solely on fips_teardown.
-         */
-        OSSL_LIB_CTX_free(libctx);
+            || (libctx = OSSL_LIB_CTX_new()) == NULL)
         goto err;
-    }
 
     if ((fgbl = ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_FIPS_PROV_INDEX)) == NULL)
         goto err;