this problem does not concerning thread locking or notThose are last two lines of my thread execution callback. If you call any openssl's free function after ERR_remove_state(0), you will have a memory leak, because it will create another thread context that will never be freed.So i can do SSL_free(clientssl); SSL_CTX_free(clientsslctx); ERR_clear_error(); ERR_remove_state(0); At the end of my thread? What kind of locking functions do I _need_? Thanks, Stephan______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]
When error is logged OpenSSL remember from witch thread it had been raised .
Simplest thing to do is to remove all error state by ERR_remove_state(0) from the thread , just before finishing it (ERR_clear_error() will clean out entire OpenSSL error stack , so may be not that good idea , and it does not affect memory leaking situation)
More complicate thing to do is remember is some kind of array all threads numbers that ever raised during run of program , at process thread (or main thread should be the name ? ) , and then calling ERR_remove_state(x) for all them.
of cause all those troubles would be saved if somebody would create one function that will erase entire error stack at once (if i will had some spare time , i will look at it)
Hawk , did you tried to activate OpenSSL memory leak checks ? What does it did ? it found something , or you were to busy :)?