summaryrefslogtreecommitdiffstats
path: root/crypto/err
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-03-11 21:53:18 +0000
committerMatt Caswell <matt@openssl.org>2016-04-14 13:19:04 +0100
commitff2344052bfa0132260ee3154962a2552f3d95f5 (patch)
tree4ab28127a480a46064e730088339e4fe6dbd7cfc /crypto/err
parent085b3860651e2ff55e28f8a28a1f66b1a3fe538f (diff)
Ensure all locks are properly cleaned up
Some locks were not being properly cleaned up during close down. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/err')
-rw-r--r--crypto/err/err.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/err/err.c b/crypto/err/err.c
index 3ee4e861d4..aff3ae5a24 100644
--- a/crypto/err/err.c
+++ b/crypto/err/err.c
@@ -113,6 +113,7 @@
#include <string.h>
#include <internal/cryptlib_int.h>
#include <internal/threads.h>
+#include <internal/err.h>
#include <openssl/lhash.h>
#include <openssl/crypto.h>
#include <openssl/buffer.h>
@@ -389,9 +390,13 @@ static void ERR_STATE_free(ERR_STATE *s)
static void do_err_strings_init(void)
{
- CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
err_string_lock = CRYPTO_THREAD_lock_new();
- CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
+}
+
+void err_cleanup(void)
+{
+ CRYPTO_THREAD_lock_free(err_string_lock);
+ err_string_lock = NULL;
}
void ERR_load_ERR_strings(void)