diff --git a/Objects/structseq.c b/Objects/structseq.c index 3e45840fb74235..aee95286f78bcf 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);