gh-122311: Fix a refleak in pickle (GH-122411)

This commit is contained in:
Serhiy Storchaka 2024-07-29 21:52:48 +03:00 committed by GitHub
parent 490e0ad83a
commit 68840e91ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -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);