[GRASS-SVN] r62074 - grass/branches/releasebranch_7_0/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 24 07:08:13 PDT 2014


Author: mmetz
Date: 2014-09-24 07:08:13 -0700 (Wed, 24 Sep 2014)
New Revision: 62074

Modified:
   grass/branches/releasebranch_7_0/lib/vector/Vlib/geos.c
Log:
Vlib: fix memory leaks in read GEOS

Modified: grass/branches/releasebranch_7_0/lib/vector/Vlib/geos.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/vector/Vlib/geos.c	2014-09-24 14:08:03 UTC (rev 62073)
+++ grass/branches/releasebranch_7_0/lib/vector/Vlib/geos.c	2014-09-24 14:08:13 UTC (rev 62074)
@@ -81,7 +81,7 @@
 GEOSGeometry *Vect_read_area_geos(struct Map_info * Map, int area)
 {
     int i, nholes, isle;
-    GEOSGeometry *boundary, **holes;
+    GEOSGeometry *boundary, *poly, **holes;
     
     G_debug(3, "Vect_read_area_geos(): area = %d", area);
 
@@ -105,7 +105,10 @@
 			  isle, area);
     }
     
-    return GEOSGeom_createPolygon(boundary, holes, nholes);
+    poly = GEOSGeom_createPolygon(boundary, holes, nholes);
+    G_free(holes);
+
+    return poly;
 }
 
 /*!
@@ -508,6 +511,7 @@
 		}
 	    }
 	}
+	GEOSCoordSeq_destroy(pseq[i]);
     }
     
     G_free((void *) pseq);



More information about the grass-commit mailing list