[Python-checkins] bpo-36126: Fix ref count leakage in structseq_repr. (GH-12035)

Serhiy Storchaka webhook-mailer at python.org
Thu Feb 28 08:19:02 EST 2019


https://github.com/python/cpython/commit/69b4a17f342146d6b7a73975a37678db9916aa75
commit: 69b4a17f342146d6b7a73975a37678db9916aa75
branch: 2.7
author: Gao, Xiang <qasdfgtyuiop at gmail.com>
committer: Serhiy Storchaka <storchaka at gmail.com>
date: 2019-02-28T15:18:48+02:00
summary:

bpo-36126: Fix ref count leakage in structseq_repr. (GH-12035)

files:
M Objects/structseq.c

diff --git a/Objects/structseq.c b/Objects/structseq.c
index 3e45840fb742..aee95286f78b 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -266,6 +266,7 @@ structseq_repr(PyStructSequence *obj)
 
         val = PyTuple_GetItem(tup, i);
         if (cname == NULL || val == NULL) {
+            Py_DECREF(tup);
             return NULL;
         }
         repr = PyObject_Repr(val);



More information about the Python-checkins mailing list