From: Alan T. DeKok Date: Thu, 1 Jun 2017 18:26:04 +0000 (-0400) Subject: set 'sess = NULL' after freeing it. Closes #1999 X-Git-Tag: release_3_0_15~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ec8284ea214cff7fcdc12e2cad627f70912e7d7;p=thirdparty%2Ffreeradius-server.git set 'sess = NULL' after freeing it. Closes #1999 --- diff --git a/src/main/tls.c b/src/main/tls.c index ce7799ed3e9..634924d8df7 100644 --- a/src/main/tls.c +++ b/src/main/tls.c @@ -1605,6 +1605,7 @@ static SSL_SESSION *cbtls_get_session(SSL *ssl, const unsigned char *data, int l /* not safe to un-persist a session w/o VPs */ RWDEBUG("Failed loading persisted VPs for session %s", buffer); SSL_SESSION_free(sess); + sess = NULL; goto error; } @@ -1618,12 +1619,14 @@ static SSL_SESSION *cbtls_get_session(SSL *ssl, const unsigned char *data, int l if (ocsp_asn1time_to_epoch(&expires, vp->vp_strvalue) < 0) { RDEBUG2("Failed getting certificate expiration, removing cache entry for session %s", buffer); SSL_SESSION_free(sess); + sess = NULL; goto error; } if (expires <= request->timestamp) { RDEBUG2("Certificate has expired, removing cache entry for session %s", buffer); SSL_SESSION_free(sess); + sess = NULL; goto error; }