]> granicus.if.org Git - python/commitdiff
Guido pointed out that I was missing a couple decrefs.
authorMichael W. Hudson <mwh@python.net>
Thu, 7 Mar 2002 15:13:40 +0000 (15:13 +0000)
committerMichael W. Hudson <mwh@python.net>
Thu, 7 Mar 2002 15:13:40 +0000 (15:13 +0000)
Objects/structseq.c

index 9228e0fdf500ba9ccd847af8d2605257c59c22d6..377dfebd2ed5599ba78cdc24381b57e8c4ecf601 100644 (file)
@@ -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 = {