summaryrefslogtreecommitdiffstats
path: root/crypto/bio
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2018-04-20 15:45:06 +0200
committerBernd Edlinger <bernd.edlinger@hotmail.de>2018-04-20 15:45:06 +0200
commiteb2b9892065cf5b69400b98ca82e4e99a525eb29 (patch)
tree0185f809739e7ffbde0ee7d477f749fd34a541ce /crypto/bio
parente1c0348cc728cb37003ae411879bd23b6a84fcc8 (diff)
Ensure the thread keys are always allocated in the same order
Fixes: #5899 Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5911)
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/b_addr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c
index 9832c0c89c..abec7bb8db 100644
--- a/crypto/bio/b_addr.c
+++ b/crypto/bio/b_addr.c
@@ -603,7 +603,8 @@ static int addrinfo_wrap(int family, int socktype,
DEFINE_RUN_ONCE_STATIC(do_bio_lookup_init)
{
- OPENSSL_init_crypto(0, NULL);
+ if (!OPENSSL_init_crypto(0, NULL))
+ return 0;
bio_lookup_lock = CRYPTO_THREAD_lock_new();
return bio_lookup_lock != NULL;
}