]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
openssl_mutexes code belongs in openssl_mgt.c
authorNick Mathewson <nickm@torproject.org>
Tue, 23 Jan 2018 19:43:06 +0000 (14:43 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 23 Jan 2018 19:43:06 +0000 (14:43 -0500)
src/common/crypto.c
src/common/crypto_openssl_mgt.c

index 3ff3a98e0dbf8fec73bceca23a4f6719a97f3afc..107b53ad29d03a3f15bf76ffd1e9fde38b34ba28 100644 (file)
@@ -3352,20 +3352,6 @@ crypto_global_cleanup(void)
   CONF_modules_unload(1);
   CRYPTO_cleanup_all_ex_data();
 
-#ifndef NEW_THREAD_API
-  if (n_openssl_mutexes_) {
-    int n = n_openssl_mutexes_;
-    tor_mutex_t **ms = openssl_mutexes_;
-    int i;
-    openssl_mutexes_ = NULL;
-    n_openssl_mutexes_ = 0;
-    for (i=0;i<n;++i) {
-      tor_mutex_free(ms[i]);
-    }
-    tor_free(ms);
-  }
-#endif /* !defined(NEW_THREAD_API) */
-
   crypto_openssl_free_all();
 
   crypto_early_initialized_ = 0;
index db5a5272637c959012f79b0793e7a2ff827c0d58..bc8f7179807914eee927aeb4f3cd09d22c213ddb 100644 (file)
@@ -143,5 +143,19 @@ crypto_openssl_free_all(void)
 {
   tor_free(crypto_openssl_version_str);
   tor_free(crypto_openssl_header_version_str);
+
+#ifndef NEW_THREAD_API
+  if (n_openssl_mutexes_) {
+    int n = n_openssl_mutexes_;
+    tor_mutex_t **ms = openssl_mutexes_;
+    int i;
+    openssl_mutexes_ = NULL;
+    n_openssl_mutexes_ = 0;
+    for (i=0;i<n;++i) {
+      tor_mutex_free(ms[i]);
+    }
+    tor_free(ms);
+  }
+#endif /* !defined(NEW_THREAD_API) */
 }