From aeb5b95576025d651c4941e7a5c157351094de84 Mon Sep 17 00:00:00 2001 From: Todd Short Date: Wed, 9 Mar 2016 10:01:43 -0500 Subject: [PATCH] Fix locking in ssl_cert_dup() Properly check the return value of CRYPTO_THREAD_lock_new() Signed-off-by: Rich Salz Reviewed-by: Matt Caswell --- ssl/ssl_cert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c index 21cfb965d2..8915531d42 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -190,7 +190,7 @@ CERT *ssl_cert_dup(CERT *cert) ret->references = 1; ret->key = &ret->pkeys[cert->key - cert->pkeys]; ret->lock = CRYPTO_THREAD_lock_new(); - if (ret == NULL) { + if (ret->lock == NULL) { SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_MALLOC_FAILURE); OPENSSL_free(ret); return NULL; -- 2.25.1