1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-22 17:39:53 +03:00

Cleanup ssl library. No memory leaks. (#143)

This commit is contained in:
Moataz Elmasry 2018-04-11 23:18:16 +02:00 committed by GitHub
parent 3f553abf1d
commit 227842f89c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4040,6 +4040,22 @@ void FreeOpenSSLThreadState()
ERR_remove_state(0); ERR_remove_state(0);
} }
void FreeSsl()
{
/* thread-safe cleanup */
ERR_remove_state(0);
ENGINE_cleanup();
CONF_modules_unload(1);
sk_free(SSL_COMP_get_compression_methods());
/* global application exit cleanup (after all SSL activity is shutdown) */
ERR_free_strings();
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
}
// Release the Crypt library // Release the Crypt library
void FreeCryptLibrary() void FreeCryptLibrary()
{ {
@ -4049,6 +4065,8 @@ void FreeCryptLibrary()
openssl_lock = NULL; openssl_lock = NULL;
// RAND_Free_For_SoftEther(); // RAND_Free_For_SoftEther();
OpenSSL_FreeLock(); OpenSSL_FreeLock();
FreeSsl();
} }
// Initialize the Crypt library // Initialize the Crypt library