aboutsummaryrefslogtreecommitdiffstats
path: root/ssl/ssl_sess.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>1999-05-23 16:19:08 +0000
committerBodo Möller <bodo@openssl.org>1999-05-23 16:19:08 +0000
commitbdc98ffba9a95ac192268001dce2fe806aeea2e7 (patch)
tree0070b6548e6ea66503472b32de8d61946a083979 /ssl/ssl_sess.c
parent38424743ce234edc77805d884399352ecc6d066e (diff)
downloadopenssl-bdc98ffba9a95ac192268001dce2fe806aeea2e7.tar.gz
Don't use NULL-pointer :-/
Diffstat (limited to 'ssl/ssl_sess.c')
-rw-r--r--ssl/ssl_sess.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index e918d9854f..97c7f33251 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -203,8 +203,9 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len)
{
CRYPTO_r_lock(CRYPTO_LOCK_SSL_CTX);
ret=(SSL_SESSION *)lh_retrieve(s->ctx->sessions,(char *)&data);
- /* don't allow other threads to steal it: */
- CRYPTO_add(&ret->references,1,CRYPTO_LOCK_SSL_SESSION);
+ if (ret != NULL)
+ /* don't allow other threads to steal it: */
+ CRYPTO_add(&ret->references,1,CRYPTO_LOCK_SSL_SESSION);
CRYPTO_r_unlock(CRYPTO_LOCK_SSL_CTX);
}