]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-36126: Fix ref count leakage in structseq_repr. (GH-12035)
authorGao, Xiang <qasdfgtyuiop@gmail.com>
Thu, 28 Feb 2019 13:18:48 +0000 (08:18 -0500)
committerSerhiy Storchaka <storchaka@gmail.com>
Thu, 28 Feb 2019 13:18:48 +0000 (15:18 +0200)
Objects/structseq.c

index 3e45840fb742351e83676e095245b9a018120b82..aee95286f78bcf88173ab756d6b81fe3221be7ae 100644 (file)
@@ -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);