Do not try to bind to statements that might not be available when preparing the database failed.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2019-09-20 22:53:49 +02:00
parent 3391714fb2
commit 12df978432
+7
View File
@@ -263,6 +263,13 @@ int gravityDB_count(const unsigned char list)
static bool domain_in_list(const char *domain, sqlite3_stmt* stmt)
{
// Do not try to bind text to statement when database is not available
if(!gravity_database_avail)
{
logg("domain_in_list(%s): Gravity database not available", domain);
return false;
}
int retval;
// Bind domain to prepared statement
// SQLITE_STATIC: Use the string without first duplicating it internally.