mirror of
https://github.com/openssl/openssl.git
synced 2024-12-12 11:33:41 +08:00
Fix locking in ssl_cert_dup()
Properly check the return value of CRYPTO_THREAD_lock_new() Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
This commit is contained in:
parent
b7aacc3ac3
commit
aeb5b95576
@ -190,7 +190,7 @@ CERT *ssl_cert_dup(CERT *cert)
|
|||||||
ret->references = 1;
|
ret->references = 1;
|
||||||
ret->key = &ret->pkeys[cert->key - cert->pkeys];
|
ret->key = &ret->pkeys[cert->key - cert->pkeys];
|
||||||
ret->lock = CRYPTO_THREAD_lock_new();
|
ret->lock = CRYPTO_THREAD_lock_new();
|
||||||
if (ret == NULL) {
|
if (ret->lock == NULL) {
|
||||||
SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_MALLOC_FAILURE);
|
SSLerr(SSL_F_SSL_CERT_DUP, ERR_R_MALLOC_FAILURE);
|
||||||
OPENSSL_free(ret);
|
OPENSSL_free(ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user