mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
[3.12] gh-122311: Fix a refleak in pickle (GH-122411) (GH-122416)
(cherry picked from commit 68840e91ac
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
e6878fc3c8
commit
bad84975ff
1 changed files with 1 additions and 0 deletions
|
@ -3188,6 +3188,7 @@ batch_dict(PickleState *state, PicklerObject *self, PyObject *iter)
|
||||||
if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 2) {
|
if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 2) {
|
||||||
PyErr_SetString(PyExc_TypeError, "dict items "
|
PyErr_SetString(PyExc_TypeError, "dict items "
|
||||||
"iterator must return 2-tuples");
|
"iterator must return 2-tuples");
|
||||||
|
Py_DECREF(obj);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
i = save(state, self, PyTuple_GET_ITEM(obj, 0), 0);
|
i = save(state, self, PyTuple_GET_ITEM(obj, 0), 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue