From 837d7dff69c9844e40d9cdd440906e2dbe97106c Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 1 Apr 2005 02:37:10 +0000 Subject: [PATCH] Try to make crash-on-shutdown bug harder to trigger. svn:r3939 --- src/common/crypto.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/common/crypto.c b/src/common/crypto.c index c88be4b829..14ffe3cfa9 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -177,12 +177,15 @@ int crypto_global_cleanup() ERR_free_strings(); #ifdef TOR_IS_MULTITHREADED if (_n_openssl_mutexes) { + int n = _n_openssl_mutexes; + tor_mutex_t **ms = _openssl_mutexes; int i; - for (i=0;i<_n_openssl_mutexes;++i) { - tor_mutex_free(_openssl_mutexes[i]); - } - tor_free(_openssl_mutexes); + _openssl_mutexes = NULL; _n_openssl_mutexes = 0; + for (i=0;i