diff options
author | Michael W. Hudson <mwh@python.net> | 2002-03-07 15:16:07 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2002-03-07 15:16:07 (GMT) |
commit | a374b6f469896e1e62b1bafaa5d5127615b0e1ef (patch) | |
tree | d50096f04d538bbbc5aa9e926a3af008f35baddf | |
parent | aa3fd6f3dfdefb1b2efe553e8e9274eb177257fb (diff) | |
download | cpython-a374b6f469896e1e62b1bafaa5d5127615b0e1ef.zip cpython-a374b6f469896e1e62b1bafaa5d5127615b0e1ef.tar.gz cpython-a374b6f469896e1e62b1bafaa5d5127615b0e1ef.tar.bz2 |
backport my checkin of
revision 1.6 of structseq.c
Guido pointed out that I was missing a couple decrefs.
-rw-r--r-- | Objects/structseq.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c index 9228e0f..377dfeb 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 = { |