Skip to content

Commit 052fd79

Browse files
committed
Followup c14352f, tweaked Coverity fixes
1 parent 65b6171 commit 052fd79

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/core/qgsvectorlayerlabelprovider.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,6 @@ QgsGeometry* QgsVectorLayerLabelProvider::getPointObstacleGeometry( QgsFeature&
319319
QgsAbstractGeometryV2* obstacleGeom = 0;
320320
if ( isMultiPoint )
321321
obstacleGeom = new QgsMultiPolygonV2();
322-
else
323-
obstacleGeom = new QgsPolygonV2();
324322

325323
// for each point
326324
for ( int i = 0; i < fet.constGeometry()->geometry()->nCoordinates(); ++i )
@@ -380,7 +378,6 @@ QgsGeometry* QgsVectorLayerLabelProvider::getPointObstacleGeometry( QgsFeature&
380378
}
381379
else
382380
{
383-
delete obstacleGeom;
384381
obstacleGeom = obstaclePolygon;
385382
}
386383
}

src/gui/editorwidgets/qgsrelationreferencewidget.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ QgsRelationReferenceWidget::QgsRelationReferenceWidget( QWidget* parent )
6060
, mMessageBar( NULL )
6161
, mForeignKey( QVariant() )
6262
, mReferencedFieldIdx( -1 )
63+
, mReferencingFieldIdx( -1 )
6364
, mAllowNull( true )
6465
, mHighlight( NULL )
6566
, mMapTool( NULL )

tests/src/core/testqgsgeometry.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ void TestQgsGeometry::pointV2()
496496
QCOMPARE( size, p12.wkbSize() );
497497
QgsPointV2 p13;
498498
p13.fromWkb( wkb );
499+
delete[] wkb;
499500
wkb = 0;
500501
QVERIFY( p13 == p12 );
501502

@@ -507,6 +508,7 @@ void TestQgsGeometry::pointV2()
507508
p13 = QgsPointV2( 1, 2 );
508509
wkb = line.asWkb( size );
509510
QVERIFY( !p13.fromWkb( wkb ) );
511+
delete[] wkb;
510512
wkb = 0;
511513
QCOMPARE( p13.wkbType(), QgsWKBTypes::Unknown );
512514

@@ -1192,7 +1194,7 @@ void TestQgsGeometry::lineStringV2()
11921194
QCOMPARE( size, l15.wkbSize() );
11931195
QgsLineStringV2 l16;
11941196
l16.fromWkb( wkb );
1195-
delete wkb;
1197+
delete[] wkb;
11961198
wkb = 0;
11971199
QCOMPARE( l16.numPoints(), 4 );
11981200
QCOMPARE( l16.vertexCount(), 4 );
@@ -1214,7 +1216,7 @@ void TestQgsGeometry::lineStringV2()
12141216
QgsPointV2 point( 1, 2 );
12151217
wkb = point.asWkb( size ) ;
12161218
QVERIFY( !l16.fromWkb( wkb ) );
1217-
delete wkb;
1219+
delete[] wkb;
12181220
wkb = 0;
12191221
QCOMPARE( l16.wkbType(), QgsWKBTypes::Unknown );
12201222

@@ -1867,7 +1869,7 @@ void TestQgsGeometry::lineStringV2()
18671869
l37.setPoints( QList< QgsPointV2 >() << QgsPointV2( 5, 10 ) << QgsPointV2( 10, 15 ) );
18681870
wkb = toAppend->asWkb( size );
18691871
l37.fromWkb( wkb );
1870-
delete wkb;
1872+
delete[] wkb;
18711873
wkb = 0;
18721874
QCOMPARE( l37.boundingBox(), QgsRectangle( 1, 0, 4, 2 ) );
18731875
l37.fromWkt( QString( "LineString( 1 5, 3 4, 6 3 )" ) );

0 commit comments

Comments
 (0)