summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-02-09 11:46:20 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-02-09 11:46:20 (GMT)
commitdfe98a102ec8723d750f78ecda08a7adb9360eb1 (patch)
treef8aea8fb3d74be18ed67a2f4e0a355ad9beb42d8 /Modules/_sqlite
parent2623c8c23cead505a78ec416072223552e94727e (diff)
parent505ff755d704c73ac613d3e8fed02c79c6ae555a (diff)
downloadcpython-dfe98a102ec8723d750f78ecda08a7adb9360eb1.zip
cpython-dfe98a102ec8723d750f78ecda08a7adb9360eb1.tar.gz
cpython-dfe98a102ec8723d750f78ecda08a7adb9360eb1.tar.bz2
Issue #20437: Fixed 22 potential bugs when deleting objects references.
Diffstat (limited to 'Modules/_sqlite')
-rw-r--r--Modules/_sqlite/cursor.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index 8d10890..ce92af6 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -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;
}