[GRASS5] [bug #869] (grass) Possible memory leak in src/libes/vect32/Vlib/get_area.c:Vect_get_area_points()

Eric G. Miller egm2 at jps.net
Thu Dec 13 01:58:56 EST 2001


On Tue, 11 Dec 2001 18:06:52 -0800, "Eric G. Miller" <egm2 at jps.net> wrote:

> On Tue, 11 Dec 2001 22:57:23 +0100 (CET), Request Tracker <grass-bugs at intevation.de> wrote:
> 
> > this bug's URL: http://intevation.de/rt/webrt?serial_num=869
> > -------------------------------------------------------------------------
> > 
> > Subject: Possible memory leak in src/libes/vect32/Vlib/get_area.c:Vect_get_area_points()
> [snip]
> > 
> >   The problem is the code
> > 
> > --
> >   BPoints->n_points = 0;
> >   BPoints->alloc_points = 0;
> >   Area =  &(Map->Area[area]) ;
> > --
> > 
> > in Vect_get_area_points(), if I replace it by
> > 
> > --
> >   G_free(BPoints->x);
> >   G_free(BPoints->y);
> >   BPoints->n_points = 0;
> >   BPoints->alloc_points = 0;
> >   Area =  &(Map->Area[area]) ;
> > --

I committed a fix which just comments out the zeroing of BPoints->alloc_points.
The dig_alloc routines should then properly handle memory without there
being leakage.  There is other leakage still, but not so egregious...

-- 
Eric G. Miller <egm2 at jps.net>



More information about the grass-dev mailing list