Issue #20437: Fixed 22 potential bugs when deleting objects references.

This commit is contained in:
Serhiy Storchaka 2014-02-09 13:46:20 +02:00
commit dfe98a102e
15 changed files with 34 additions and 63 deletions

View file

@ -229,8 +229,7 @@ int pysqlite_build_row_cast_map(pysqlite_Cursor* self)
if (converter != Py_None) {
Py_DECREF(converter);
}
Py_XDECREF(self->row_cast_map);
self->row_cast_map = NULL;
Py_CLEAR(self->row_cast_map);
return -1;
}
@ -447,8 +446,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
self->locked = 1;
self->reset = 0;
Py_XDECREF(self->next_row);
self->next_row = NULL;
Py_CLEAR(self->next_row);
if (multiple) {
/* executemany() */
@ -864,8 +862,7 @@ PyObject* pysqlite_cursor_iternext(pysqlite_Cursor *self)
if (!self->next_row) {
if (self->statement) {
(void)pysqlite_statement_reset(self->statement);
Py_DECREF(self->statement);
self->statement = NULL;
Py_CLEAR(self->statement);
}
return NULL;
}