[Box Backup-commit] COMMIT r1311 - box/chris/general/lib/server
boxbackup-dev@fluffy.co.uk
boxbackup-dev@fluffy.co.uk
Sat, 03 Mar 2007 21:35:10 +0000
Author: chris
Date: 2007-03-03 21:35:10 +0000 (Sat, 03 Mar 2007)
New Revision: 1311
Modified:
box/chris/general/lib/server/TLSContext.cpp
Log:
Fix memory leak. (from chris/merge)
Modified: box/chris/general/lib/server/TLSContext.cpp
===================================================================
--- box/chris/general/lib/server/TLSContext.cpp 2007-03-03 21:34:46 UTC (rev 1310)
+++ box/chris/general/lib/server/TLSContext.cpp 2007-03-03 21:35:10 UTC (rev 1311)
@@ -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)
{