[leafnode-list] Re: Memory leak (Was: Limiting leafnode run time and/or memory usage?)

Lloyd Zusman ljz at asfast.com
Mon Dec 27 23:32:05 CET 2004


On Mon, Dec 27, 2004 at 08:05:15PM +0100, Matthias Andree wrote:
> On Sun, 26 Dec 2004, Lloyd Zusman wrote:
> 
> > There appears to be a significant memory leak in leafnode-20041215a.
> > 
> > [ ... ]
> 
> Right. This patch (from DARCS) should fix the problem:
>
> [ ... ]

Thanks for this fix!

Yes, this seems to correct the memory leak, but unfortunately, there
is a slight problem with the patch.  The patch puts a superfluous
"free(overview)" at the end of the xgetover() routine.  This will
free an already freed block, which can have unpredictable results.
If you look 37-38 lines before the end of that routine, you'll see
that the "overview" block is already being freed at that point.

Apply the following patch AFTER applying the one that fixes the 
memory leak:


*** xoverutil.c.orig	Mon Dec 27 17:22:56 2004
--- xoverutil.c	Mon Dec 27 17:24:13 2004
***************
*** 564,570 ****
  	g->count = current;
      }
  
-     free(overview);
      return 1;
  }
  
--- 564,569 ----




-- 
 Lloyd Zusman
 ljz at asfast.com
 God bless you.



More information about the leafnode-list mailing list