defdict_reduce(): Plug leaks.

We didn't notice these before because test_defaultdict didn't
actually do anything before Georg fixed that earlier today.
Neal's next refleak run then showed test_defaultdict leaking
9 references on each run.  That's repaired by this checkin.
This commit is contained in:
Tim Peters 2006-07-28 00:23:15 +00:00
parent d17301f95c
commit 5566e96830

View file

@ -1117,7 +1117,7 @@ defdict_copy(defdictobject *dd)
static PyObject *
defdict_reduce(defdictobject *dd)
{
/* __reduce__ must returns a 5-tuple as follows:
/* __reduce__ must return a 5-tuple as follows:
- factory function
- tuple of args for the factory function
@ -1155,6 +1155,7 @@ defdict_reduce(defdictobject *dd)
}
result = PyTuple_Pack(5, dd->dict.ob_type, args,
Py_None, Py_None, items);
Py_DECREF(items);
Py_DECREF(args);
return result;
}