From ec384be55d983ee85564b077ea4f5a751ba3f5d2 Mon Sep 17 00:00:00 2001 From: imaginos Date: Thu, 31 Mar 2005 20:40:44 +0000 Subject: [PATCH] return null on unused ssl session git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@52 726aef4b-f618-498e-8847-2d620e286838 --- Csocket.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Csocket.h b/Csocket.h index 8c0e2701..c4b4dc1c 100644 --- a/Csocket.h +++ b/Csocket.h @@ -1505,7 +1505,13 @@ namespace Csocket void SetSSLObject( SSL *ssl ) { m_ssl = ssl; } void SetCTXObject( SSL_CTX *sslCtx ) { m_ssl_ctx = sslCtx; } void SetFullSSLAccept() { m_bFullsslAccept = true; } - SSL_SESSION * GetSSLSession() { return( SSL_get_session( m_ssl ) ); } + SSL_SESSION * GetSSLSession() + { + if ( m_ssl ) + return( SSL_get_session( m_ssl ) ); + + return( NULL ); + } #endif /* HAVE_LIBSSL */ //! Get the send buffer