summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite/cursor.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_sqlite/cursor.c')
-rw-r--r--Modules/_sqlite/cursor.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index 4eb9c6d..7656c90 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -507,13 +507,8 @@ _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* operation
if (self->statement->in_use) {
Py_SETREF(self->statement,
- PyObject_GC_New(pysqlite_Statement, pysqlite_StatementType));
- if (!self->statement) {
- goto error;
- }
- rc = pysqlite_statement_create(self->statement, self->connection, operation);
- if (rc != SQLITE_OK) {
- Py_CLEAR(self->statement);
+ pysqlite_statement_create(self->connection, operation));
+ if (self->statement == NULL) {
goto error;
}
}