summaryrefslogtreecommitdiffstats
path: root/Objects/bytesobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-02 16:46:19 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-02 16:46:19 (GMT)
commit8911ef5b6da16e4d4a640bcd70ee4c473aa1178f (patch)
treee9a86217a77fb90056388adc906c5a9ebeb7cf78 /Objects/bytesobject.c
parent8f59021a108ab9b002877783b76d36377af4e6e2 (diff)
parentd357a3f841ee41cee55575b5729658b5ecd45902 (diff)
downloadcpython-8911ef5b6da16e4d4a640bcd70ee4c473aa1178f.zip
cpython-8911ef5b6da16e4d4a640bcd70ee4c473aa1178f.tar.gz
cpython-8911ef5b6da16e4d4a640bcd70ee4c473aa1178f.tar.bz2
Issue #17034: Use Py_CLEAR() in bytesobject.c.
Diffstat (limited to 'Objects/bytesobject.c')
-rw-r--r--Objects/bytesobject.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 20de5cc..ba1fefd 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -2754,8 +2754,7 @@ PyBytes_Concat(register PyObject **pv, register PyObject *w)
if (*pv == NULL)
return;
if (w == NULL) {
- Py_DECREF(*pv);
- *pv = NULL;
+ Py_CLEAR(*pv);
return;
}
v = bytes_concat(*pv, w);
@@ -2819,12 +2818,9 @@ void
PyBytes_Fini(void)
{
int i;
- for (i = 0; i < UCHAR_MAX + 1; i++) {
- Py_XDECREF(characters[i]);
- characters[i] = NULL;
- }
- Py_XDECREF(nullstring);
- nullstring = NULL;
+ for (i = 0; i < UCHAR_MAX + 1; i++)
+ Py_CLEAR(characters[i]);
+ Py_CLEAR(nullstring);
}
/*********************** Bytes Iterator ****************************/