Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-94028: Clear and reset sqlite3 statements properly in cursor iternext
  • Loading branch information
erlend-aasland committed Jun 20, 2022
commit 239ead3de23e39b869f460acf20fb5c112ffb749
3 changes: 3 additions & 0 deletions Modules/_sqlite/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1129,10 +1129,13 @@ pysqlite_cursor_iternext(pysqlite_Cursor *self)
self->rowcount = (long)sqlite3_changes(self->connection->db);
}
(void)stmt_reset(self->statement);
Py_CLEAR(self->statement);
}
else if (rc != SQLITE_ROW) {
(void)_pysqlite_seterror(self->connection->state,
self->connection->db);
(void)stmt_reset(self->statement);
Py_CLEAR(self->statement);
Py_DECREF(row);
return NULL;
}
Expand Down