mirror of
https://github.com/python/cpython.git
synced 2026-04-13 15:20:52 +00:00
gh-145376: Avoid reference leaks in failure path of _functoolsmodule.c method partial_new (GH-145423)
This commit is contained in:
parent
3fe7849d9a
commit
f9dac4e2eb
1 changed files with 5 additions and 0 deletions
|
|
@ -252,6 +252,11 @@ partial_new(PyTypeObject *type, PyObject *args, PyObject *kw)
|
|||
}
|
||||
PyObject *item;
|
||||
PyObject *tot_args = PyTuple_New(tot_nargs);
|
||||
if (tot_args == NULL) {
|
||||
Py_DECREF(new_args);
|
||||
Py_DECREF(pto);
|
||||
return NULL;
|
||||
}
|
||||
for (Py_ssize_t i = 0, j = 0; i < tot_nargs; i++) {
|
||||
if (i < npargs) {
|
||||
item = PyTuple_GET_ITEM(pto_args, i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue