Skip to content
Permalink
Browse files

Fix leak in virtual layers

  • Loading branch information
nyalldawson committed Mar 11, 2018
1 parent eb49513 commit 30749ef80c375a351bed0dcbe107e098d2e8bcfb
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/providers/virtual/qgsvirtuallayerqueryparser.cpp
@@ -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() );

0 comments on commit 30749ef

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