[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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@xxxxxxxxxx
 God bless you.
-- 
_______________________________________________
leafnode-list mailing list
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
http://www.dt.e-technik.uni-dortmund.de/mailman/listinfo/leafnode-list
http://leafnode.sourceforge.net/