From ea31804d470cbf45a80875e012910011c7a99eb3 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Sat, 17 Apr 2010 11:06:07 +0000 Subject: [PATCH] Plug a couple of memory leaks git-svn-id: http://svn.osgeo.org/postgis/trunk@5564 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/lwgeom_geos.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c index 57a04dd3d..040b669dd 100644 --- a/postgis/lwgeom_geos.c +++ b/postgis/lwgeom_geos.c @@ -3576,7 +3576,12 @@ LWGEOM2GEOS(LWGEOM *lwgeom) for (i=0; igeoms[i]); - if ( ! g ) return NULL; + if ( ! g ) + { + while (i) GEOSGeom_destroy(geoms[--i]); + free(geoms); + return NULL; + } geoms[i] = g; } g = GEOSGeom_createCollection(geostype, geoms, ngeoms); -- 2.50.1