summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGao, Xiang <qasdfgtyuiop@gmail.com>2019-02-28 13:18:48 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2019-02-28 13:18:48 (GMT)
commit69b4a17f342146d6b7a73975a37678db9916aa75 (patch)
tree008ef63613c9ce6561ee36a791e047c3d0656928
parenta588343390356f5f7bb40e25371f0f2a092d6d72 (diff)
downloadcpython-69b4a17f342146d6b7a73975a37678db9916aa75.zip
cpython-69b4a17f342146d6b7a73975a37678db9916aa75.tar.gz
cpython-69b4a17f342146d6b7a73975a37678db9916aa75.tar.bz2
bpo-36126: Fix ref count leakage in structseq_repr. (GH-12035)
-rw-r--r--Objects/structseq.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c
index 3e45840..aee9528 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);