[Box Backup-commit] COMMIT r1150 - box/chris/merge/lib/server

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Mon Nov 13 15:49:48 GMT 2006


Author: chris
Date: 2006-11-13 15:49:48 +0000 (Mon, 13 Nov 2006)
New Revision: 1150

Modified:
   box/chris/merge/lib/server/TLSContext.cpp
Log:
Fix memory leak when TLSContext is reinitialised (refs #3)


Modified: box/chris/merge/lib/server/TLSContext.cpp
===================================================================
--- box/chris/merge/lib/server/TLSContext.cpp	2006-11-13 15:48:02 UTC (rev 1149)
+++ box/chris/merge/lib/server/TLSContext.cpp	2006-11-13 15:49:48 UTC (rev 1150)
@@ -61,6 +61,11 @@
 // --------------------------------------------------------------------------
 void TLSContext::Initialise(bool AsServer, const char *CertificatesFile, const char *PrivateKeyFile, const char *TrustedCAsFile)
 {
+	if(mpContext != 0)
+	{
+		::SSL_CTX_free(mpContext);
+	}
+
 	mpContext = ::SSL_CTX_new(AsServer?TLSv1_server_method():TLSv1_client_method());
 	if(mpContext == NULL)
 	{




More information about the Boxbackup-commit mailing list