Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
TlsSocket: Fix deprecated OpenSSL calls #600
This PR has exposed a memory leak in NZBGet.
If during download OpenSSL happens to create error queue in each thread then all of these queues remain unfreed.
To fix the issue every thread which might have to do anything with connections (certainly every download thread at least) must call that function.
I've found that topic where authors of libcurl encountered that issue as well:
Well said, ha-ha.
I don't know if I should fix that or not. There is no simple and elegant fix for this. I'm certainly not going to put OpenSSL call into common thread termination code in
On the bright side, there is no leak if you use OpenSSL >= 1.1.0 ;)
"They are now deprecated and do nothing, as the OpenSSL libraries now normally do all thread initialisation and deinitialisation automatically."
And from the 1.0.2 man page:
"ERR_remove_state() is available in all versions of SSLeay and OpenSSL. It was deprecated in OpenSSL 1.0.0 when ERR_remove_thread_state was introduced and thread IDs were introduced to identify threads instead of 'unsigned long'."