summaryrefslogtreecommitdiff
path: root/crypto/context.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2021-11-09 13:48:31 +0000
committerMatt Caswell <matt@openssl.org>2021-11-12 17:16:14 +0000
commitcad22202a32a94059e351d9819e6c9ed5c66605a (patch)
tree2e9ace55274f11f3c7b51e4bb04d325201495e5b /crypto/context.c
parente39bd6215123f375ddcfe92fa2b2550294da0b73 (diff)
downloadopenssl-new-cad22202a32a94059e351d9819e6c9ed5c66605a.tar.gz
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 <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16980)
Diffstat (limited to 'crypto/context.c')
-rw-r--r--crypto/context.c4
1 files changed, 4 insertions, 0 deletions
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);
}