Skip to content

Commit

Permalink
Fix leak in virtual layers
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 11, 2018
1 parent eb49513 commit 30749ef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/providers/virtual/qgsvirtuallayerqueryparser.cpp
Expand Up @@ -40,7 +40,12 @@ namespace QgsVirtualLayerQueryParser
{
char *errMsg = nullptr;
int r = sqlite3_exec( db.get(), query.toUtf8().constData(), nullptr, nullptr, &errMsg );
QString err = QString::fromUtf8( errMsg );
QString err;
if ( r != SQLITE_OK )
{
err = QString::fromUtf8( errMsg );
sqlite3_free( errMsg );
}
if ( r && err.startsWith( noSuchError ) )
{
QString tableName = err.mid( noSuchError.size() );
Expand Down

0 comments on commit 30749ef

Please sign in to comment.