diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-09 11:33:53 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-09 11:33:53 (GMT) |
commit | 505ff755d704c73ac613d3e8fed02c79c6ae555a (patch) | |
tree | b9b0142cbeca125a1bcf0413e48d938d0cd390d3 /Modules/_sqlite | |
parent | e9c31470e1680b7c9b9ee83c378b891e90ac58ab (diff) | |
download | cpython-505ff755d704c73ac613d3e8fed02c79c6ae555a.zip cpython-505ff755d704c73ac613d3e8fed02c79c6ae555a.tar.gz cpython-505ff755d704c73ac613d3e8fed02c79c6ae555a.tar.bz2 |
Issue #20437: Fixed 21 potential bugs when deleting objects references.
Diffstat (limited to 'Modules/_sqlite')
-rw-r--r-- | Modules/_sqlite/cursor.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c index 4999415..09c13d4 100644 --- a/Modules/_sqlite/cursor.c +++ b/Modules/_sqlite/cursor.c @@ -230,8 +230,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; } @@ -443,8 +442,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() */ @@ -860,8 +858,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; } |