> The function SSL_library_init() is observed to be introudcing
> memory leak in
> the application code. There is still some amount of memory leak left even
> after the series of cleanup calls suggested in the openssl FAQ.
>
> Can someone help understand that technically what is the problem
> in having a
> single cleanup call like SSL_library_cleanup, instead of a using
> a series of
> cleanup calls?

It's pretty much the same issue as every other library in the world. Perfect
cleanup is extremely difficult and often adds performance overhead during
use. Since nobody really cares whether you can free every single byte before
you terminate a process, nobody bothers to code it. For example, singletons
can be very difficult to remove. How and when do you remove a memory
manager?

As for the series of cleanup calls, there are several reasons. The two main
ones are that you might need to cleanup different things and some cleanup
functions need to be called from a particular context.

Your first sentence is pretty funny though. How can a function you can only
call once in the lifetime of a process introduce a memory leak?

DS


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to