diff options
author | Chris Wilson <chris+github@qwirx.com> | 2006-11-13 15:49:48 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2006-11-13 15:49:48 +0000 |
commit | 13def59b473a788b89c5857be0502c330d944c64 (patch) | |
tree | e15c3568e7814f6ae101d709b5b623f096c1b511 | |
parent | b876d56a587877fbf9f98224bf97fa7d3b2622e4 (diff) |
Fix memory leak when TLSContext is reinitialised (refs #3)
-rw-r--r-- | lib/server/TLSContext.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/server/TLSContext.cpp b/lib/server/TLSContext.cpp index cc125d00..49143801 100644 --- a/lib/server/TLSContext.cpp +++ b/lib/server/TLSContext.cpp @@ -61,6 +61,11 @@ TLSContext::~TLSContext() // -------------------------------------------------------------------------- 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) { |