From: Geoff Thorpe Date: Mon, 8 Sep 2003 16:00:46 +0000 (+0000) Subject: These should be write-locks, not read-locks. X-Git-Tag: OpenSSL_0_9_7c~19 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=62afa8bd587346b688efd9f6f2667bb7e036845c;p=oweals%2Fopenssl.git These should be write-locks, not read-locks. --- diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index fbc30b94e6..fabcdefa6e 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -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 * somebody doesn't free ssl->session between when we check it's * 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; if(sess) sess->references++; - CRYPTO_r_unlock(CRYPTO_LOCK_SSL_SESSION); + CRYPTO_w_unlock(CRYPTO_LOCK_SSL_SESSION); return(sess); }