CRYPTO_add(&ret->references,1,CRYPTO_LOCK_SSL_SESSION);
#endif
- if ((long)(ret->time+ret->timeout) < (long)time(NULL)) /* timeout */
+ if (ret->timeout < (long)(time(NULL) - ret->time)) /* timeout */
{
s->ctx->stats.sess_timeout++;
/* remove it from the cache */