From: Sandro Santilli Date: Fri, 21 Dec 2012 10:53:12 +0000 (+0000) Subject: Fix memory leak in lwcollection_homogenize X-Git-Tag: 2.1.0beta2~262 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6af9dfa74e1c0577e9dbad71e6951bbc77120847;p=postgis Fix memory leak in lwcollection_homogenize git-svn-id: http://svn.osgeo.org/postgis/trunk@10896 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwhomogenize.c b/liblwgeom/lwhomogenize.c index f2ee9dc5f..f7e580e3b 100644 --- a/liblwgeom/lwhomogenize.c +++ b/liblwgeom/lwhomogenize.c @@ -139,7 +139,7 @@ lwcollection_homogenize(const LWCOLLECTION *col) if ( outcol->ngeoms == 1 ) { outgeom = outcol->geoms[0]; - lwfree(outcol); + outcol->ngeoms=0; lwcollection_free(outcol); } else { @@ -161,7 +161,7 @@ lwcollection_homogenize(const LWCOLLECTION *col) if ( bcol->ngeoms == 1 ) { lwcollection_add_lwgeom(outcol, bcol->geoms[0]); - lwfree(bcol); + bcol->ngeoms=0; lwcollection_free(bcol); } else { @@ -171,7 +171,7 @@ lwcollection_homogenize(const LWCOLLECTION *col) } outgeom = lwcollection_as_lwgeom(outcol); } - + return outgeom; }