[GRASS-SVN] r71514 - grass/trunk/vector/v.in.ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Sep 28 13:14:17 PDT 2017


Author: mmetz
Date: 2017-09-28 13:14:17 -0700 (Thu, 28 Sep 2017)
New Revision: 71514

Modified:
   grass/trunk/vector/v.in.ogr/main.c
Log:
v.in.ogr: fix usage of OGR_G_GetLinearGeometry() to avoid memory leaks

Modified: grass/trunk/vector/v.in.ogr/main.c
===================================================================
--- grass/trunk/vector/v.in.ogr/main.c	2017-09-28 17:31:48 UTC (rev 71513)
+++ grass/trunk/vector/v.in.ogr/main.c	2017-09-28 20:14:17 UTC (rev 71514)
@@ -952,6 +952,9 @@
                         poly_count(Ogr_geometry, (type & GV_BOUNDARY));
                     if (OGR_G_GetCoordinateDimension(Ogr_geometry) > 2)
                         input3d = 1;
+#if GDAL_VERSION_NUM >= 2000000
+		    OGR_G_DestroyGeometry(Ogr_geometry);
+#endif
                 }
 #if GDAL_VERSION_NUM >= 1110000                
             }
@@ -1277,6 +1280,9 @@
 
                     geom(Ogr_geometry, Out, layer + 1, cat, min_area, type,
                          flag.no_clean->answer);
+#if GDAL_VERSION_NUM >= 2000000
+		    OGR_G_DestroyGeometry(Ogr_geometry);
+#endif
                 }
 #if GDAL_VERSION_NUM >= 1110000              
             }
@@ -1565,6 +1571,9 @@
 #endif
                         centroid(Ogr_geometry, Centr, &si, layer + 1, cat,
                                  min_area, type);
+#if GDAL_VERSION_NUM >= 2000000
+			OGR_G_DestroyGeometry(Ogr_geometry);
+#endif
                     }
 #if GDAL_VERSION_NUM >= 1110000
                 }



More information about the grass-commit mailing list