memory still reachable post calling SSL_CTX_free

Matt Caswell matt at openssl.org
Tue Jun 21 11:08:43 UTC 2022



On 21/06/2022 11:42, Tomas Mraz wrote:

> This is actually not a memory allocated by the SSL_CTX_new() itself but
> error string data that is global. There is no real memory leak here.
> You can call OPENSSL_cleanup() to explicitly de-allocate all the global
> data however please note that you can do it really only before
> immediate exit of the application using OpenSSL otherwise you risk
> crashes if something tries to call OpenSSL again after
> OPENSSL_cleanup() was called.

Better is to not call OPENSSL_cleanup() explicitly at all and just leave 
it. OPENSSL_cleanup() is called automatically at process exit.

Matt



More information about the openssl-users mailing list