wsd: free leaking memory

With help from Valgrind to find and verify
these leaks.

Change-Id: I3afeed89dc4bcd714a222f81822144477a346fb0
Reviewed-on: https://gerrit.libreoffice.org/39464
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This commit is contained in:
Ashod Nakashian
2017-07-02 22:10:23 -04:00
committed by Ashod Nakashian
parent 98dd83338c
commit 4f8ebca0cb
4 changed files with 10 additions and 0 deletions

View File

@ -615,6 +615,10 @@ private:
// Invoke the virtual implementation.
pollingThread();
// Release sockets.
_pollSockets.clear();
_newSockets.clear();
}
catch (const std::exception& exc)
{

View File

@ -123,6 +123,7 @@ SslContext::SslContext(const std::string& certFilePath,
SslContext::~SslContext()
{
SSL_CTX_free(_ctx);
EVP_cleanup();
ERR_free_strings();
CRYPTO_set_locking_callback(0);

View File

@ -31,6 +31,9 @@ public:
/// Read all files that we can serve into memory and compress them.
static void initialize();
/// Clean cached files.
static void uninitialize() { FileHash.clear(); }
static void readDirToHash(const std::string &basePath, const std::string &path);
static const std::string *getCompressedFile(const std::string &path);

View File

@ -2672,6 +2672,8 @@ int LOOLWSD::innerMain()
void LOOLWSD::cleanup()
{
FileServerRequestHandler::uninitialize();
// Finally, we no longer need SSL.
if (LOOLWSD::isSSLEnabled())
{