Commit 0bde9d01 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

SqliteTools: Fix memory leak

parent eb467da0
......@@ -4,17 +4,10 @@
bool SqliteTools::createTable( sqlite3 *db, const char* request )
{
sqlite3_stmt* stmt;
int res = sqlite3_prepare_v2( db, request, -1, &stmt, NULL );
if ( res != SQLITE_OK )
{
std::cerr << "Failed to execute request: " << request << std::endl;
std::cerr << sqlite3_errmsg( db ) << std::endl;
return false;
}
res = sqlite3_step( stmt );
auto stmt = executeRequest( db, request );
int res = sqlite3_step( stmt.get() );
while ( res != SQLITE_DONE && res != SQLITE_ERROR )
res = sqlite3_step( stmt );
res = sqlite3_step( stmt.get() );
if ( res == SQLITE_ERROR )
{
std::cerr << "Failed to execute request: " << request << std::endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment