Skip to content

Commit

Permalink
Fix some Coverity use-after-free warnings
Browse files Browse the repository at this point in the history
(cherry-picked from eb39579)
  • Loading branch information
nyalldawson committed Apr 6, 2018
1 parent 2900ae2 commit 3db0569
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -7368,8 +7368,10 @@ QgsLayoutDesignerDialog *QgisApp::createNewPrintLayout( const QString &t )
QgsPrintLayout *layout = new QgsPrintLayout( QgsProject::instance() );
layout->setName( title );
layout->initializeDefaults();
QgsProject::instance()->layoutManager()->addLayout( layout );
return openLayoutDesignerDialog( layout );
if ( QgsProject::instance()->layoutManager()->addLayout( layout ) )
return openLayoutDesignerDialog( layout );
else
return nullptr;
}

QgsLayoutDesignerDialog *QgisApp::createNewReport( QString title )
Expand Down
4 changes: 2 additions & 2 deletions src/core/processing/models/qgsprocessingmodelalgorithm.cpp
Expand Up @@ -961,8 +961,8 @@ bool QgsProcessingModelAlgorithm::activateChildAlgorithm( const QString &id )

void QgsProcessingModelAlgorithm::addModelParameter( QgsProcessingParameterDefinition *definition, const QgsProcessingModelParameter &component )
{
addParameter( definition );
mParameterComponents.insert( definition->name(), component );
if ( addParameter( definition ) )
mParameterComponents.insert( definition->name(), component );
}

void QgsProcessingModelAlgorithm::updateModelParameter( QgsProcessingParameterDefinition *definition )
Expand Down

0 comments on commit 3db0569

Please sign in to comment.