1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-23 01:49:53 +03:00

Merge PR #884: Fix memory leak in OpenSSL deinitialization function

This commit is contained in:
Davide Beatrici 2019-02-27 21:47:52 +01:00 committed by GitHub
commit ba94d8a6fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -18,6 +18,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <time.h> #include <time.h>
#include <errno.h> #include <errno.h>
#include <openssl/crypto.h>
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/rand.h> #include <openssl/rand.h>
@ -3684,6 +3685,10 @@ void FreeOpenSSLThreadState()
#if OPENSSL_VERSION_NUMBER < 0x10100000L #if OPENSSL_VERSION_NUMBER < 0x10100000L
CRYPTO_cleanup_all_ex_data(); CRYPTO_cleanup_all_ex_data();
ERR_remove_thread_state(NULL); ERR_remove_thread_state(NULL);
#else
#ifndef LIBRESSL_VERSION_NUMBER
OPENSSL_thread_stop();
#endif
#endif #endif
} }

View File

@ -566,15 +566,15 @@ void FreeMayaqua()
// Release of real-time clock // Release of real-time clock
FreeTick64(); FreeTick64();
// Release of crypt library
FreeCryptLibrary();
// Release of the string library // Release of the string library
FreeStringLibrary(); FreeStringLibrary();
// Release of thread pool // Release of thread pool
FreeThreading(); FreeThreading();
// Release of crypt library
FreeCryptLibrary();
if (IsTrackingEnabled()) if (IsTrackingEnabled())
{ {
// Show the kernel status // Show the kernel status