Hi!

I have an example case where by the unused memoy allocated by SSL_library_init when not freed, would accumulate.

There is an application which takes services from some of the libraries say A, B and C.

These libraries are dynamically loaded and unloaded into the application as and when required depending on certain conditions and using g_module_xxxx calls.

All of these plugin libraries call SSL_library_init() and since we do not know how many times in the lifespan of the application these libraries would be loaded/unloaded, we dont know how many times SSL_library_init() would get called.

regards

-Nitin


From: "David Schwartz" <[EMAIL PROTECTED]>
Reply-To: openssl-dev@openssl.org
To: <openssl-dev@openssl.org>
Subject: RE: Memory Leaks in SSL_Library_init()
Date: Tue, 20 Mar 2007 05:02:01 -0700


> 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]

_________________________________________________________________
Spice up your IM conversations. New, colorful and animated emoticons. Get chatting! http://server1.msn.co.in/SP05/emoticons/

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

Reply via email to