summaryrefslogtreecommitdiff
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-02-09 13:33:53 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2014-02-09 13:33:53 +0200
commit505ff755d704c73ac613d3e8fed02c79c6ae555a (patch)
treeb9b0142cbeca125a1bcf0413e48d938d0cd390d3 /Objects/unicodeobject.c
parente9c31470e1680b7c9b9ee83c378b891e90ac58ab (diff)
downloadcpython-git-505ff755d704c73ac613d3e8fed02c79c6ae555a.tar.gz
Issue #20437: Fixed 21 potential bugs when deleting objects references.
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index beafaa4496..e1ff999e13 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1846,8 +1846,7 @@ _PyUnicode_ClearStaticStrings()
{
_Py_Identifier *tmp, *s = static_strings;
while (s) {
- Py_DECREF(s->object);
- s->object = NULL;
+ Py_CLEAR(s->object);
tmp = s->next;
s->next = NULL;
s = tmp;
@@ -4082,8 +4081,7 @@ make_decode_exception(PyObject **exceptionObject,
return;
onError:
- Py_DECREF(*exceptionObject);
- *exceptionObject = NULL;
+ Py_CLEAR(*exceptionObject);
}
/* error handling callback helper:
@@ -6224,8 +6222,7 @@ make_encode_exception(PyObject **exceptionObject,
goto onError;
return;
onError:
- Py_DECREF(*exceptionObject);
- *exceptionObject = NULL;
+ Py_CLEAR(*exceptionObject);
}
}
@@ -8225,8 +8222,7 @@ make_translate_exception(PyObject **exceptionObject,
goto onError;
return;
onError:
- Py_DECREF(*exceptionObject);
- *exceptionObject = NULL;
+ Py_CLEAR(*exceptionObject);
}
}