Commit 38a663cf authored by Tim Peters's avatar Tim Peters

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.
parent 42cf1258
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment