Skip to content
Permalink
Browse files

Fix leak in virtual layers

(cherry-picked from 30749ef)
  • Loading branch information
nyalldawson committed Mar 15, 2018
1 parent 87e8f9f commit 1fc184f08f97368924c7724cb53c5a6f70f297d8
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 1fc184f

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