Make removal from session cache more robust.

This commit is contained in:
Lutz Jänicke
2002-02-10 12:46:41 +00:00
parent 182d8435f0
commit acfe628b6e
2 changed files with 9 additions and 3 deletions

View File

@@ -474,10 +474,10 @@ static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *c, int lck)
if ((c != NULL) && (c->session_id_length != 0))
{
if(lck) CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX);
r=(SSL_SESSION *)lh_delete(ctx->sessions,c);
if (r != NULL)
if ((r = (SSL_SESSION *)lh_retrieve(ctx->sessions,c)) == c)
{
ret=1;
r=(SSL_SESSION *)lh_delete(ctx->sessions,c);
SSL_SESSION_list_remove(ctx,c);
}