[Box Backup-commit] COMMIT r1150 - box/chris/merge/lib/server
boxbackup-dev@fluffy.co.uk
boxbackup-dev@fluffy.co.uk
Mon, 13 Nov 2006 15:49:48 +0000
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)
{