Ticket #4264 (closed defect: fixed)
Mem leak in OGRGeometry::Intersects (and other)
| Reported by: | ftrastour | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.9.0 |
| Component: | OGR_SF | Version: | unspecified |
| Severity: | normal | Keywords: | OGR Memory leak |
| Cc: |
Description
In ogrgeometry.cpp, OGRGeometry::Intersects calls exportToGEOS for the two concerned geometries but deletes objects returned by these calls only if the two calls were successfull. If only one call returned 0, the other result is not freed.
hThisGeosGeom = exportToGEOS();
hOtherGeosGeom = poOtherGeom->exportToGEOS();
if( hThisGeosGeom != NULL && hOtherGeosGeom != NULL )
{
bResult = GEOSOverlaps( hThisGeosGeom, hOtherGeosGeom );
GEOSGeom_destroy( hThisGeosGeom );
GEOSGeom_destroy( hOtherGeosGeom );
}
Some other functions in this file are implemented in the same way : OGRGeometry::Overlaps, OGRGeometry *OGRGeometry::Intersection OGRGeometry::Union OGRGeometry::Difference OGRGeometry::SymDifference? OGRGeometry::Disjoint OGRGeometry::Touches OGRGeometry::Crosses OGRGeometry::Within OGRGeometry::Contains OGRGeometry::Overlaps
Change History
Note: See
TracTickets for help on using
tickets.
