httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Stoddard <b...@wstoddard.com>
Subject Re: Potential memory leak in /modules/cache/mod_mem_cache.c
Date Wed, 02 Nov 2005 21:47:10 GMT
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...
> 
> Christophe JAILLET
> 

Agreed, looks like a bug and your fix looks right.

Bill


Mime
View raw message