diff options
author | Michael W. Hudson <mwh@python.net> | 2002-03-07 15:13:40 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2002-03-07 15:13:40 (GMT) |
commit | 70ffddf8af51c826e9dd7af857d15787f4863ba0 (patch) | |
tree | 52ab94740e63f72e22a5eecbf7c9d95c00f6688c | |
parent | 594bc80c4699083dfb5d98f35cf0d196228d8a6e (diff) | |
download | cpython-70ffddf8af51c826e9dd7af857d15787f4863ba0.zip cpython-70ffddf8af51c826e9dd7af857d15787f4863ba0.tar.gz cpython-70ffddf8af51c826e9dd7af857d15787f4863ba0.tar.bz2 |
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 = { |