These should be write-locks, not read-locks.
This commit is contained in:
parent
a907751350
commit
9ea72d3705
@ -79,11 +79,11 @@ SSL_SESSION *SSL_get1_session(SSL *ssl)
|
|||||||
/* Need to lock this all up rather than just use CRYPTO_add so that
|
/* Need to lock this all up rather than just use CRYPTO_add so that
|
||||||
* somebody doesn't free ssl->session between when we check it's
|
* somebody doesn't free ssl->session between when we check it's
|
||||||
* non-null and when we up the reference count. */
|
* non-null and when we up the reference count. */
|
||||||
CRYPTO_r_lock(CRYPTO_LOCK_SSL_SESSION);
|
CRYPTO_w_lock(CRYPTO_LOCK_SSL_SESSION);
|
||||||
sess = ssl->session;
|
sess = ssl->session;
|
||||||
if(sess)
|
if(sess)
|
||||||
sess->references++;
|
sess->references++;
|
||||||
CRYPTO_r_unlock(CRYPTO_LOCK_SSL_SESSION);
|
CRYPTO_w_unlock(CRYPTO_LOCK_SSL_SESSION);
|
||||||
return(sess);
|
return(sess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user