bpo-36126: Fix ref count leakage in structseq_repr. (GH-12035)
https://github.com/python/cpython/commit/69b4a17f342146d6b7a73975a37678db991... commit: 69b4a17f342146d6b7a73975a37678db9916aa75 branch: 2.7 author: Gao, Xiang <qasdfgtyuiop@gmail.com> committer: Serhiy Storchaka <storchaka@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);
participants (1)
-
Serhiy Storchaka