mirror of
https://github.com/python/cpython.git
synced 2025-11-25 12:44:13 +00:00
gh-126991: Fix reference leak in loading pickle's opcode BUILD (GH-126990)
If PyObject_SetItem() fails in the `load_build()` function of _pickle.c, no DECREF for the `dict` variable.
This commit is contained in:
parent
c5c9286804
commit
29cbcbd73b
1 changed files with 1 additions and 0 deletions
|
|
@ -6730,6 +6730,7 @@ load_build(PickleState *st, UnpicklerObject *self)
|
||||||
}
|
}
|
||||||
if (PyObject_SetItem(dict, d_key, d_value) < 0) {
|
if (PyObject_SetItem(dict, d_key, d_value) < 0) {
|
||||||
Py_DECREF(d_key);
|
Py_DECREF(d_key);
|
||||||
|
Py_DECREF(dict);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
Py_DECREF(d_key);
|
Py_DECREF(d_key);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue