Skip to content
Permalink
Browse files

Fix cppcheck reports:

[src/providers/ogr/qgsogrprovider.cpp:1071]: (error) Memory leak: oldlocale
[src/providers/ogr/qgsogrprovider.cpp:1268]: (error) Memory leak: oldlocale
[src/core/spatialite/spatialite.c:50598]: (error) Memory leak: reader
[tests/src/core/testqgscolorscheme.cpp:155]: (error) Memory leak: dummyScheme2
[src/core/spatialite/spatialite.c:40138]: (error) Memory leak: ln
  • Loading branch information
serval2412 authored and jef-n committed Dec 30, 2014
1 parent 5a1df4a commit e6561cec68ea06a85c5c9c0e4acdb955f510c850
double m;
if (ln1->DimensionModel == GAIA_XY_Z)
ln = gaiaAllocLinestringXYZ (points);
if (ln1->DimensionModel == GAIA_XY_M)
else if (ln1->DimensionModel == GAIA_XY_M)
ln = gaiaAllocLinestringXYM (points);
if (ln1->DimensionModel == GAIA_XY_Z_M)
else if (ln1->DimensionModel == GAIA_XY_Z_M)
ln = gaiaAllocLinestringXYZM (points);
else
ln = gaiaAllocLinestring (points);
if (reader->toUtf8 == (void *) 0)
{
fclose (in);
free(reader);
return NULL;
}
reader->error = 0;
@@ -1067,6 +1067,8 @@ bool QgsOgrProvider::addFeature( QgsFeature& f )
OGR_F_Destroy( feature );

setlocale( LC_NUMERIC, oldlocale );
if (oldlocale)
free(oldlocale);

return returnValue;
}
@@ -1265,6 +1267,8 @@ bool QgsOgrProvider::changeAttributeValues( const QgsChangedAttributesMap & attr
}

setlocale( LC_NUMERIC, oldlocale );
if (oldlocale)
free(oldlocale);
}

if ( OGR_L_SyncToDisk( ogrLayer ) != OGRERR_NONE )
@@ -152,6 +152,8 @@ void TestQgsColorScheme::clone()
QgsColorScheme* dummyScheme2 = dummyScheme->clone();
QgsNamedColorList colors2 = dummyScheme2->fetchColors();
QCOMPARE( colors, colors2 );
delete dummyScheme;
delete dummyScheme2;
}

QTEST_MAIN( TestQgsColorScheme )

0 comments on commit e6561ce

Please sign in to comment.
You can’t perform that action at this time.