summaryrefslogtreecommitdiffstats
path: root/providers
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2021-07-27 16:31:20 +0100
committerPauli <pauli@openssl.org>2021-07-28 10:34:53 +1000
commit09f38299ccc006e0ce7e94897250e995ec2fc337 (patch)
treead56395ce1f2bb74d0badc39cc94ea6c5b8d7540 /providers
parent2a7855fb2596048e5038afa5e49a02853297df6d (diff)
Don't leak the OSSL_LIB_CTX in the event of a failure to load the FIPS module
Ensure we free the OSSL_LIB_CTX on the error path. Fixes #16163 Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16168)
Diffstat (limited to 'providers')
-rw-r--r--providers/fips/fipsprov.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/providers/fips/fipsprov.c b/providers/fips/fipsprov.c
index 4155b64197..b69299e046 100644
--- a/providers/fips/fipsprov.c
+++ b/providers/fips/fipsprov.c
@@ -712,6 +712,7 @@ int OSSL_provider_init_int(const OSSL_CORE_HANDLE *handle,
return 1;
err:
fips_teardown(*provctx);
+ OSSL_LIB_CTX_free(libctx);
*provctx = NULL;
return 0;
}