Calling OpenSSL_thread_stop() multiple times
matt at openssl.org
Wed Aug 23 09:33:43 UTC 2023
On 22/08/2023 19:40, Dipak B wrote:
> Not calling Openssl_stop_thread() leads to memory leaks inside
> ERR_get_error() for me.
> So, can following be supported?
> Communicate.DLL statically linked to ossl 3.x & libcurl 8.x exporting 3
> SSL_library_init(); or openssl_int_ssl(load no err strings)
> curl_easy_init(); // multiple times generating curl handles to be stored
> in array of say 16
> curl_easy_cleanup(); // multiples times for each handle inside array
> Openssl_stop_thread(); // once for each curl handle; so 16 times
> // openssl_stop_thread(); // having this here solves the memory leak for me
> TalkToWeb() is called by new threads (each invocation is with new
> thread) created by an executable which loads communicate.DLL
> Execution of above code leads to accumulation of memory until Shutdown()
> is called.
> Libcurl encourages handle re-use.
I'm not really clear what your asking here. OPENSSL_thread_stop() must
only be called once per thread, and you cannot use OpenSSL on that
thread after that point. As long as you obey those rules then you should
More information about the openssl-users