From: Michael W. Hudson Date: Thu, 7 Mar 2002 15:16:07 +0000 (+0000) Subject: backport my checkin of X-Git-Tag: v2.2.1c1~98 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a374b6f469896e1e62b1bafaa5d5127615b0e1ef;p=thirdparty%2FPython%2Fcpython.git backport my checkin of revision 1.6 of structseq.c Guido pointed out that I was missing a couple decrefs. --- 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 = {