Skip to content

Commit

Permalink
Fix memory leak in OGR provider when feature has no geometry
Browse files Browse the repository at this point in the history
and FilterRect is used
  • Loading branch information
nyalldawson committed May 10, 2016
1 parent effb8dc commit 6b80518
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/providers/ogr/qgsogrfeatureiterator.cpp
Expand Up @@ -238,13 +238,14 @@ bool QgsOgrFeatureIterator::fetchFeature( QgsFeature& feature )
{
if ( !readFeature( fet, feature ) )
continue;
else
OGR_F_Destroy( fet );

if ( !mRequest.filterRect().isNull() && !feature.constGeometry() )
continue;

// we have a feature, end this cycle
feature.setValid( true );
OGR_F_Destroy( fet );
return true;

} // while
Expand Down

0 comments on commit 6b80518

Please sign in to comment.