[geos-commits] r4122 - in trunk: capi include/geos/algorithm src/algorithm

svn_geos at osgeo.org svn_geos at osgeo.org
Mon Nov 30 02:06:16 PST 2015


Author: strk
Date: 2015-11-30 02:06:15 -0800 (Mon, 30 Nov 2015)
New Revision: 4122

Modified:
   trunk/capi/geos_ts_c.cpp
   trunk/include/geos/algorithm/SIRtreePointInRing.h
   trunk/src/algorithm/SIRtreePointInRing.cpp
Log:
Fix some leaks identified by Coverity

Patch by Nyall Dawson <nyall.dawson at gmail.com>

Modified: trunk/capi/geos_ts_c.cpp
===================================================================
--- trunk/capi/geos_ts_c.cpp	2015-11-30 10:00:36 UTC (rev 4121)
+++ trunk/capi/geos_ts_c.cpp	2015-11-30 10:06:15 UTC (rev 4122)
@@ -3151,6 +3151,7 @@
                 break;
             default:
                 handle->ERROR_MESSAGE("Unsupported type request for PostGIS2GEOS_collection");
+                delete vgeoms;
                 g = 0;
                 
         }
@@ -4177,6 +4178,7 @@
         if ( ! nshell )
         {
             handle->ERROR_MESSAGE("Shell is not a LinearRing");
+            delete vholes;
             return NULL;
         }
         const GeometryFactory *gf = handle->geomFactory;

Modified: trunk/include/geos/algorithm/SIRtreePointInRing.h
===================================================================
--- trunk/include/geos/algorithm/SIRtreePointInRing.h	2015-11-30 10:00:36 UTC (rev 4121)
+++ trunk/include/geos/algorithm/SIRtreePointInRing.h	2015-11-30 10:06:15 UTC (rev 4122)
@@ -49,6 +49,7 @@
 			geom::LineSegment *seg);
 public:
 	SIRtreePointInRing(geom::LinearRing *newRing);
+	~SIRtreePointInRing();
 	bool isInside(const geom::Coordinate& pt);
 };
 

Modified: trunk/src/algorithm/SIRtreePointInRing.cpp
===================================================================
--- trunk/src/algorithm/SIRtreePointInRing.cpp	2015-11-30 10:00:36 UTC (rev 4121)
+++ trunk/src/algorithm/SIRtreePointInRing.cpp	2015-11-30 10:06:15 UTC (rev 4122)
@@ -41,6 +41,11 @@
 	buildIndex();
 }
 
+SIRtreePointInRing::~SIRtreePointInRing()
+{
+	delete sirTree;
+}
+
 void
 SIRtreePointInRing::buildIndex()
 {



More information about the geos-commits mailing list