[Python-checkins] gh-101765: unicodeobject: use Py_XDECREF correctly (GH-102283)

miss-islington webhook-mailer at python.org
Sun Feb 26 18:09:25 EST 2023


https://github.com/python/cpython/commit/64d3715de89467971f40f24cce8c435a24f6b3c4
commit: 64d3715de89467971f40f24cce8c435a24f6b3c4
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2023-02-26T15:09:18-08:00
summary:

gh-101765: unicodeobject: use Py_XDECREF correctly (GH-102283)

(cherry picked from commit 8d0f09b1beafd95763a5da53acc58dac0bd63a53)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra at gmail.com>

files:
M Objects/unicodeobject.c

diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 9b8296ca6bb0..84d17f000b41 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -15768,7 +15768,7 @@ unicodeiter_reduce(unicodeiterobject *it, PyObject *Py_UNUSED(ignored))
     } else {
         PyObject *u = (PyObject *)_PyUnicode_New(0);
         if (u == NULL) {
-            Py_DECREF(iter);
+            Py_XDECREF(iter);
             return NULL;
         }
         return Py_BuildValue("N(N)", iter, u);



More information about the Python-checkins mailing list