From cad22202a32a94059e351d9819e6c9ed5c66605a Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Tue, 9 Nov 2021 13:48:31 +0000 Subject: Stop receiving child callbacks in a child libctx when appropriate We should stop receiving child callbacks if we're about to free up the child libctx. Otherwise we can get callbacks when the libctx is half freed up. Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/16980) --- crypto/context.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crypto/context.c') diff --git a/crypto/context.c b/crypto/context.c index 1e0dfa8e01..bba8e4208b 100644 --- a/crypto/context.c +++ b/crypto/context.c @@ -240,6 +240,10 @@ void OSSL_LIB_CTX_free(OSSL_LIB_CTX *ctx) if (ossl_lib_ctx_is_default(ctx)) return; +#ifndef FIPS_MODULE + if (ctx->ischild) + ossl_provider_deinit_child(ctx); +#endif context_deinit(ctx); OPENSSL_free(ctx); } -- cgit v1.2.1