summaryrefslogtreecommitdiffstats
path: root/crypto/ex_data.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-09-05 14:12:58 +0100
committerMatt Caswell <matt@openssl.org>2016-09-08 12:40:19 +0100
commit135648bcd0e9db029582d3d7627a90a1b566c5d6 (patch)
tree9f27d7c5bc25abe4355872360aa99ffd86358e36 /crypto/ex_data.c
parent2d11f5b2ca863d4bd9e20b224932b247ed85842b (diff)
Fix mem leaks during auto-deinit
Certain functions are automatically called during auto-deinit in order to deallocate resources. However, if we have never entered a function which marks lib crypto as inited then they never get called. This can happen if the user only ever makes use of a small sub-set of functions that don't hit the auto-init code. This commit ensures all such resources deallocated by these functions also init libcrypto when they are initially allocated. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Ben Laurie <ben@openssl.org>
Diffstat (limited to 'crypto/ex_data.c')
-rw-r--r--crypto/ex_data.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/ex_data.c b/crypto/ex_data.c
index 986ef70bc4..bb1af0b3b1 100644
--- a/crypto/ex_data.c
+++ b/crypto/ex_data.c
@@ -38,6 +38,7 @@ static CRYPTO_ONCE ex_data_init = CRYPTO_ONCE_STATIC_INIT;
DEFINE_RUN_ONCE_STATIC(do_ex_data_init)
{
+ OPENSSL_init_crypto(0, NULL);
ex_data_lock = CRYPTO_THREAD_lock_new();
return ex_data_lock != NULL;
}