ssb: Free sqlite3_exec errors.
This commit is contained in:
11
src/ssb.db.c
11
src/ssb.db.c
@ -31,6 +31,10 @@ static int _tf_ssb_db_try_exec(sqlite3* db, const char* statement)
|
||||
{
|
||||
tf_printf("Error running '%s': %s.\n", statement, error ? error : sqlite3_errmsg(db));
|
||||
}
|
||||
if (error)
|
||||
{
|
||||
sqlite3_free(error);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -41,6 +45,13 @@ static void _tf_ssb_db_exec(sqlite3* db, const char* statement)
|
||||
if (result != SQLITE_OK)
|
||||
{
|
||||
tf_printf("Error running '%s': %s.\n", statement, error ? error : sqlite3_errmsg(db));
|
||||
}
|
||||
if (error)
|
||||
{
|
||||
sqlite3_free(error);
|
||||
}
|
||||
if (result != SQLITE_OK)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user