Skip to content

Commit 68840e9

Browse files
gh-122311: Fix a refleak in pickle (GH-122411)
1 parent 490e0ad commit 68840e9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/_pickle.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3123,6 +3123,7 @@ batch_dict(PickleState *state, PicklerObject *self, PyObject *iter)
31233123
if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 2) {
31243124
PyErr_SetString(PyExc_TypeError, "dict items "
31253125
"iterator must return 2-tuples");
3126+
Py_DECREF(obj);
31263127
return -1;
31273128
}
31283129
i = save(state, self, PyTuple_GET_ITEM(obj, 0), 0);

0 commit comments

Comments
 (0)