openssl_mutexes code belongs in openssl_mgt.c

This commit is contained in:
Nick Mathewson 2018-01-23 14:43:06 -05:00
parent fa694f5af3
commit 23473f5e74
2 changed files with 14 additions and 14 deletions

View 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;

View 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) */
}