From: Sandro Santilli Date: Wed, 26 Aug 2015 10:19:58 +0000 (+0000) Subject: Fix memory leak in _lwt_CheckEdgeCrossing, used by edge adding funx X-Git-Tag: 2.2.0rc1~93 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=043391c59b5e42f1300ada3f2781ca601ae88878;p=postgis Fix memory leak in _lwt_CheckEdgeCrossing, used by edge adding funx Thanks Alessandro Furieri for spotting this git-svn-id: http://svn.osgeo.org/postgis/trunk@13999 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwgeom_topo.c b/liblwgeom/lwgeom_topo.c index 8df4b2465..c28d63f86 100644 --- a/liblwgeom/lwgeom_topo.c +++ b/liblwgeom/lwgeom_topo.c @@ -666,10 +666,11 @@ _lwt_CheckEdgeCrossing( LWT_TOPOLOGY* topo, match = GEOSRelatePatternMatch(relate, "F********"); if ( match ) { + /* error or no interior intersection */ + GEOSGeom_destroy(eegg); if ( match == 2 ) { GEOSPreparedGeom_destroy(prepared_edge); GEOSGeom_destroy(edgegg); - GEOSGeom_destroy(eegg); GEOSFree(relate); lwerror("GEOSRelatePatternMatch error: %s", lwgeom_geos_errmsg); return -1;