summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-02-02 16:45:22 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-02-02 16:45:22 (GMT)
commitf458a036178844beae8bc332e5b5a0570276be3c (patch)
tree765df2a515f2ad2c9db0657cbac8d8177c0cf708
parent44b8cbfcba9d11469cf975c128b777ff512ddf61 (diff)
downloadcpython-f458a036178844beae8bc332e5b5a0570276be3c.zip
cpython-f458a036178844beae8bc332e5b5a0570276be3c.tar.gz
cpython-f458a036178844beae8bc332e5b5a0570276be3c.tar.bz2
Issue #17034: Use Py_CLEAR() in 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 c0f5aff..b60a8b0 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -2800,8 +2800,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);
@@ -3008,12 +3007,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 ****************************/