From: Pauli Date: Mon, 4 Sep 2023 04:37:09 +0000 (+1000) Subject: remove redundant free of NULL X-Git-Tag: openssl-3.2.0-alpha2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c37184f502eb7341e3095ef358a9ebd21facbc46;p=thirdparty%2Fopenssl.git remove redundant free of NULL Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/21964) --- diff --git a/providers/fips/fipsprov.c b/providers/fips/fipsprov.c index 0a95d2364d4..607ee117631 100644 --- a/providers/fips/fipsprov.c +++ b/providers/fips/fipsprov.c @@ -697,15 +697,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;