diff options
author | Matt Caswell <matt@openssl.org> | 2016-09-05 14:12:58 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-09-08 12:43:04 +0100 |
commit | ea42bd40595faefb19e2ec8d7a9efad4f75cff80 (patch) | |
tree | ce8ae6da767bf017e685132438a2428c56a9231f /crypto/err | |
parent | baee63371d568a2439cd1dddf584bcdf19b7cbbc (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>
(cherry picked from commit 135648bcd0e9db029582d3d7627a90a1b566c5d6)
Diffstat (limited to 'crypto/err')
-rw-r--r-- | crypto/err/err.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/err/err.c b/crypto/err/err.c index 584bb9e10d..c3f7212a78 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -251,6 +251,7 @@ static void ERR_STATE_free(ERR_STATE *s) DEFINE_RUN_ONCE_STATIC(do_err_strings_init) { + OPENSSL_init_crypto(0, NULL); err_string_lock = CRYPTO_THREAD_lock_new(); return err_string_lock != NULL; } |