]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #17034: Use Py_CLEAR() in bytesobject.c.
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 2 Feb 2013 16:45:22 +0000 (18:45 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 2 Feb 2013 16:45:22 +0000 (18:45 +0200)
Objects/bytesobject.c

index c0f5aff7dc23e60df298fece49c617715aa2f63b..b60a8b06c336cbe6d87ef8bd506976ba012e52c9 100644 (file)
@@ -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 ****************************/