ssb: Free sqlite3_exec errors.

This commit is contained in:
2025-06-07 10:36:44 -04:00
parent 2a53892581
commit dc9a279991
2 changed files with 22 additions and 3 deletions

View File

@ -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();
}
}