summaryrefslogtreecommitdiffstats
path: root/crypto/init.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2019-06-18 18:37:38 +0100
committerMatt Caswell <matt@openssl.org>2019-06-19 11:54:34 +0100
commit6913f5fe05a38fa72213b5b5d1f41ef10ca908bd (patch)
tree386fad30f5f06eaed4cdadcd8a24a36b4e09aff1 /crypto/init.c
parentd73458d17ac7e44270a2bcbace45ab99334754b4 (diff)
Provide an ability to deregister thread stop handlers
If a provider gets unloaded then any thread stop handlers that it had registered will be left hanging. We should clean them up before tearing down the provider. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9186)
Diffstat (limited to 'crypto/init.c')
-rw-r--r--crypto/init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/init.c b/crypto/init.c
index 8755e2164f..d5f0ebd7b7 100644
--- a/crypto/init.c
+++ b/crypto/init.c
@@ -428,8 +428,6 @@ void OPENSSL_cleanup(void)
err_free_strings_int();
}
- ossl_cleanup_thread();
-
/*
* Note that cleanup order is important:
* - rand_cleanup_int could call an ENGINE's RAND cleanup function so
@@ -457,6 +455,8 @@ void OPENSSL_cleanup(void)
OSSL_TRACE(INIT, "OPENSSL_cleanup: openssl_ctx_default_deinit()\n");
openssl_ctx_default_deinit();
+ ossl_cleanup_thread();
+
OSSL_TRACE(INIT, "OPENSSL_cleanup: bio_cleanup()\n");
bio_cleanup();