diff options
-rw-r--r-- | src/common/crypto.c | 3 | ||||
-rw-r--r-- | src/common/crypto_openssl.c | 8 | ||||
-rw-r--r-- | src/common/crypto_openssl.h | 3 |
3 files changed, 12 insertions, 2 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index 0abb4a1afb..12f4270cc4 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -3348,8 +3348,7 @@ crypto_global_cleanup(void) } #endif /* !defined(NEW_THREAD_API) */ - tor_free(crypto_openssl_version_str); - tor_free(crypto_openssl_header_version_str); + free_openssl(); return 0; } diff --git a/src/common/crypto_openssl.c b/src/common/crypto_openssl.c index 03485c0520..e7495f9720 100644 --- a/src/common/crypto_openssl.c +++ b/src/common/crypto_openssl.c @@ -113,3 +113,11 @@ setup_openssl_threading(void) return 0; } +/** free OpenSSL variables */ +void +free_openssl(void) +{ + tor_free(crypto_openssl_version_str); + tor_free(crypto_openssl_header_version_str); +} + diff --git a/src/common/crypto_openssl.h b/src/common/crypto_openssl.h index 7b5545f69c..0c6bccad41 100644 --- a/src/common/crypto_openssl.h +++ b/src/common/crypto_openssl.h @@ -101,5 +101,8 @@ void tor_set_openssl_thread_id(CRYPTO_THREADID *threadid); /* OpenSSL threading setup function */ int setup_openssl_threading(void); +/* Tor OpenSSL utility functions */ +void free_openssl(void); + #endif /* !defined(TOR_CRYPTO_OPENSSL_H) */ |