https://github.com/python/cpython/commit/68840e91ac6689d3954b98a9ab136e194b5250b8
commit: 68840e91ac6689d3954b98a9ab136e194b5250b8
branch: main
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2024-07-29T21:52:48+03:00
summary:
gh-122311: Fix a refleak in pickle (GH-122411)
files:
M Modules/_pickle.c
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index 452b4aff0237ca..50c73dca0db281 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -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);
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]