Skip to content
Permalink
Browse files

Fix memory leak, potential crash when creating QgsVectorLayerSimpleLa…

…beling

Identified by Coverity
  • Loading branch information
nyalldawson committed May 29, 2017
1 parent fb76383 commit fa3e01409fdb2f2a55a21e782527482c692ba903
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/core/qgsvectorlayerlabeling.cpp
@@ -78,13 +78,13 @@ bool QgsVectorLayerSimpleLabeling::requiresAdvancedEffects() const

QgsVectorLayerSimpleLabeling *QgsVectorLayerSimpleLabeling::create( const QDomElement &element, const QgsReadWriteContext &context )
{
QgsPalLayerSettings *settings = nullptr;
QDomElement settingsElem = element.firstChildElement( QStringLiteral( "settings" ) );
if ( !settingsElem.isNull() )
{
settings = new QgsPalLayerSettings;
settings->readXml( settingsElem, context );
QgsPalLayerSettings settings;
settings.readXml( settingsElem, context );
return new QgsVectorLayerSimpleLabeling( settings );
}

return new QgsVectorLayerSimpleLabeling( *settings );
return new QgsVectorLayerSimpleLabeling( QgsPalLayerSettings() );
}

0 comments on commit fa3e014

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