mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
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
This commit is contained in:
parent
5a1df4a2d5
commit
e6561cec68
@ -40130,9 +40130,9 @@ fnct_aux_join_segments (gaiaLinestringPtr ln1, gaiaLinestringPtr ln2,
|
||||
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);
|
||||
@ -50595,6 +50595,7 @@ gaiaTextReaderAlloc (const char *path, char field_separator,
|
||||
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 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user