From: Gao, Xiang Date: Thu, 28 Feb 2019 13:18:48 +0000 (-0500) Subject: bpo-36126: Fix ref count leakage in structseq_repr. (GH-12035) X-Git-Tag: v2.7.17rc1~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69b4a17f342146d6b7a73975a37678db9916aa75;p=thirdparty%2FPython%2Fcpython.git bpo-36126: Fix ref count leakage in structseq_repr. (GH-12035) --- 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);