[openssl-users] Proper cleanup functions being called?
Avery A. Tarasov
Avery.A.Tarasov at SecurityEngineer.Pro
Thu Jan 22 05:36:08 UTC 2015
I am using OpenSSL 1.0.1lin Win32 environment. At the beginning of my
program I call
Those functions are only called once.
Then I have 3 threads which can't possibly be run at the same time due
to mutexes I'm setting with WaitForSingleObject and ReleaseMutex. Those
3 threads use these functions below and all variables in those threads
are local to the threads (e.g. no globals).
(cleanup functions.. if conditions used to prevent double frees, etc.)
My questions are the following:
1) Am I correct that I only need to call the SSL_library_init(); and
SSL_load_error_strings(); once at the beginning of the program , and
not at the beginning of each thread?
2) Should I be doing any other cleanup functions within the threads?
My program appears to work perfectly but a tool is complaining about
memory leaks in _CRYPTO_malloc, _asn1_enc_save, _asn1_item_ex_d2i,
In fact I get memory leaks reported if I just do SSL_library_init(); alone
Despite the reports of the leaks my program seems to run fine for days
and stay consistent in memory used. But I'm feeling paranoid something
just isn't quite right.
Should I be doing any other cleanup operations?
Thanks for the assistance.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the openssl-users