mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
[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 29cbcbd73b
)
Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com>
This commit is contained in:
parent
3fae84fe58
commit
bb98a0afd8
1 changed files with 1 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue