Skip to content

Commit 6b80518

Browse files
committedMay 10, 2016
Fix memory leak in OGR provider when feature has no geometry
and FilterRect is used
1 parent effb8dc commit 6b80518

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/providers/ogr/qgsogrfeatureiterator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,14 @@ bool QgsOgrFeatureIterator::fetchFeature( QgsFeature& feature )
238238
{
239239
if ( !readFeature( fet, feature ) )
240240
continue;
241+
else
242+
OGR_F_Destroy( fet );
241243

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

245247
// we have a feature, end this cycle
246248
feature.setValid( true );
247-
OGR_F_Destroy( fet );
248249
return true;
249250

250251
} // while

0 commit comments

Comments
 (0)