Fix possible resource leaks

See issue #1691.
This commit is contained in:
Martin Kleusberg
2018-12-27 11:55:21 +01:00
parent c531752fd9
commit c00c20b8bc
2 changed files with 10 additions and 3 deletions
+2 -1
View File
@@ -247,8 +247,9 @@ void RowLoader::process (Task & t)
QMutexLocker lk(&cache_mutex);
cache_data.set(row++, std::move(rowdata));
}
sqlite3_finalize(stmt);
}
sqlite3_finalize(stmt);
if(row != t.row_begin)
emit fetched(t.token, t.row_begin, row);
+8 -2
View File
@@ -1051,9 +1051,15 @@ QVariant DBBrowserDB::querySingleValueFromDb(const QString& statement, bool log)
else
return "";
}
sqlite3_finalize(stmt);
} else {
lastErrorMessage = tr("didn't receive any output from %1").arg(sql);
qWarning() << lastErrorMessage;
}
sqlite3_finalize(stmt);
} else {
lastErrorMessage = tr("could not execute command: %1").arg(sqlite3_errmsg(_db));
qWarning() << lastErrorMessage;
}
return QVariant();