From a374b6f469896e1e62b1bafaa5d5127615b0e1ef Mon Sep 17 00:00:00 2001 From: "Michael W. Hudson" Date: Thu, 7 Mar 2002 15:16:07 +0000 Subject: [PATCH] backport my checkin of revision 1.6 of structseq.c Guido pointed out that I was missing a couple decrefs. --- Objects/structseq.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Objects/structseq.c b/Objects/structseq.c index 9228e0fdf500..377dfebd2ed5 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -233,6 +233,7 @@ structseq_reduce(PyStructSequence* self) { PyObject* tup; PyObject* dict; + PyObject* result; long n_fields, n_visible_fields; int i; @@ -259,7 +260,12 @@ structseq_reduce(PyStructSequence* self) self->ob_item[i]); } - return Py_BuildValue("(O(OO))", self->ob_type, tup, dict); + result = Py_BuildValue("(O(OO))", self->ob_type, tup, dict); + + Py_DECREF(tup); + Py_DECREF(dict); + + return result; } static PySequenceMethods structseq_as_sequence = { -- 2.47.3