[geos-devel] [GEOS] #944: Multiple memory leaks in SIRtreePointInRing

GEOS geos-trac at osgeo.org
Tue Dec 4 11:35:35 PST 2018

#944: Multiple memory leaks in SIRtreePointInRing
 Reporter:  dbaston     |      Owner:  geos-devel@…
     Type:  defect      |     Status:  new
 Priority:  major       |  Milestone:
Component:  Default     |    Version:  master
 Severity:  Unassigned  |   Keywords:
 In `SIRtreePointInRing::isInside(const Coordinate& pt)`

 A vector is never freed:

 `vector<void*> *segs=sirTree->query(pt.y);`

 In `SIRtreePointInRing::buildIndex()`

 LineSegments are added to a tree, but are never cleaned up:

 for(std::size_t i=1; i<npts; ++i)
   if(pts->getAt(i-1)==pts->getAt(i)) continue; // Optimization suggested
 by MD. [Jon Aquino]
   LineSegment *seg=new LineSegment(pts->getAt(i-1), pts->getAt(i));
   sirTree->insert(seg->p0.y, seg->p1.y, seg);

Ticket URL: <https://trac.osgeo.org/geos/ticket/944>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).

More information about the geos-devel mailing list