summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-02 16:45:54 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-02 16:45:54 (GMT)
commitd357a3f841ee41cee55575b5729658b5ecd45902 (patch)
tree84b2ac1a52dfd7df94ab4ebb19322e588cf997a1 /Objects
parentd4198c42349206149fa7b94097137eb4fc9b02e8 (diff)
parentf458a036178844beae8bc332e5b5a0570276be3c (diff)
downloadcpython-d357a3f841ee41cee55575b5729658b5ecd45902.zip
cpython-d357a3f841ee41cee55575b5729658b5ecd45902.tar.gz
cpython-d357a3f841ee41cee55575b5729658b5ecd45902.tar.bz2
Issue #17034: Use Py_CLEAR() in bytesobject.c.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/bytesobject.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index bb9c6fb..5e17107 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -2831,8 +2831,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);
@@ -2896,12 +2895,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 ****************************/