x509: publish X509_PUBKEY_dup
[openssl.git] / crypto / init.c
index fd24e4f50b7208fee4fbc3c1ea759a5dbdda58d7..d5f0ebd7b75d5f98ddc3a6859cb20fa2fdb940aa 100644 (file)
@@ -56,7 +56,7 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_base)
         goto err;
     OPENSSL_cpuid_setup();
 
-    if (!init_thread())
+    if (!ossl_init_thread())
         return 0;
 
     base_inited = 1;
@@ -428,8 +428,6 @@ void OPENSSL_cleanup(void)
         err_free_strings_int();
     }
 
-    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();