httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: Potential memory leak in /modules/cache/mod_mem_cache.c
Date Wed, 02 Nov 2005 21:45:54 GMT


On 11/02/2005 09:58 PM, Christophe Jaillet wrote:
> Comments agains httpd-2.1.8-beta
> =================================
> 
> In file mod_mem_cache.c (/modules/cache) around line 558, there is a malloc
> (*obj).
> A few lines later, another malloc (buf) is performed.
> 
> If the second malloc fails, then we have (*obj = NULL) but I don't see
> anyway to free the memory allocated.
> I would have imagined something like
> free (*obj);
> *obj = NULL;
> 
> Unless, as a newbie in apache, there is something I don't know about memory
> management in apache...

Well spotted.

mod_mem_cache currently does not get much attention from developer side as we all
focus on mod_disk_cache which seems to be even faster in most situations than
mod_mem_cache.

Finding calls to malloc and friends in the code of mod_mem_cache is a clear documentation
that there is no development care of this code as they should not be used inside of
httpd code. Throughout the httpd code memory pools will be used to aquire memory for storing
data structures.

As we have recently cleaned up all dead MPM's from the 2.2.x branch, should we do the same
with mod_mem_cache? It seems really unmaintained to me.


Regards

RĂ¼diger

Mime
View raw message