https://github.com/python/cpython/commit/bb98a0afd8598ce80f0e6d3f768b128eab68f40a commit: bb98a0afd8598ce80f0e6d3f768b128eab68f40a branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: serhiy-storchaka <[email protected]> date: 2024-11-19T20:19:39+02:00 summary:
[3.13] gh-126991: Fix reference leak in loading pickle's opcode BUILD (GH-126990) (GH-127018) If PyObject_SetItem() fails in the `load_build()` function of _pickle.c, no DECREF for the `dict` variable. (cherry picked from commit 29cbcbd73bbfd8c953c0b213fb33682c289934ff) Co-authored-by: Justin Applegate <[email protected]> files: M Modules/_pickle.c diff --git a/Modules/_pickle.c b/Modules/_pickle.c index d20f3e5097a3a0..9bb3947e0967a4 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -6659,6 +6659,7 @@ load_build(PickleState *st, UnpicklerObject *self) } if (PyObject_SetItem(dict, d_key, d_value) < 0) { Py_DECREF(d_key); + Py_DECREF(dict); goto error; } Py_DECREF(d_key); _______________________________________________ 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]
