[GRASS-SVN] r62073 - grass/trunk/lib/vector/Vlib

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


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

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

Modified: grass/trunk/lib/vector/Vlib/geos.c
===================================================================
--- grass/trunk/lib/vector/Vlib/geos.c	2014-09-24 13:26:36 UTC (rev 62072)
+++ grass/trunk/lib/vector/Vlib/geos.c	2014-09-24 14:08:03 UTC (rev 62073)
@@ -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