mirror of https://github.com/python/cpython
[3.13] gh-122311: Fix a refleak in pickle (GH-122411) (GH-122415)
(cherry picked from commit 68840e91ac
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
9f6f8790ef
commit
d8701e2f7e
|
@ -3123,6 +3123,7 @@ batch_dict(PickleState *state, PicklerObject *self, PyObject *iter)
|
|||
if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 2) {
|
||||
PyErr_SetString(PyExc_TypeError, "dict items "
|
||||
"iterator must return 2-tuples");
|
||||
Py_DECREF(obj);
|
||||
return -1;
|
||||
}
|
||||
i = save(state, self, PyTuple_GET_ITEM(obj, 0), 0);
|
||||
|
|
Loading…
Reference in New Issue