Skip to content

Commit 12bb96e

Browse files
Reset in iternext on error path
1 parent 317607b commit 12bb96e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Modules/_sqlite/cursor.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,8 @@ pysqlite_cursor_iternext(pysqlite_Cursor *self)
11241124
else if (rc != SQLITE_ROW) {
11251125
(void)_pysqlite_seterror(self->connection->state,
11261126
self->connection->db);
1127+
(void)stmt_reset(self->statement);
1128+
Py_CLEAR(self->statement);
11271129
Py_DECREF(row);
11281130
return NULL;
11291131
}

0 commit comments

Comments
 (0)