sqlite3: Fix a segfault on calling a connection with something else than a
string. Initialize all attributes to be able to call the statement destructor
on error.
Avoid also a duplicate connection in some tests: setUp() does already open a
connection (":memory:").
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 6bc495a..64e27cd 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -1197,6 +1197,12 @@
return NULL;
}
+ statement->db = NULL;
+ statement->st = NULL;
+ statement->sql = NULL;
+ statement->in_use = 0;
+ statement->in_weakreflist = NULL;
+
rc = pysqlite_statement_create(statement, self, sql);
if (rc != SQLITE_OK) {