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

(cherry-picked from 6b80518)
  • Loading branch information
nyalldawson committed May 16, 2016
1 parent 8f0ee1f commit 7a4ef0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/providers/ogr/qgsogrfeatureiterator.cpp
Expand Up @@ -226,13 +226,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 7a4ef0d

Please sign in to comment.