mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
GH-139757: Fix reference leaks introduced in GH-140800 (GH-142257)
This commit is contained in:
parent
fb404ab575
commit
6825d5c11d
1 changed files with 4 additions and 2 deletions
|
|
@ -1228,6 +1228,8 @@ _Py_BuildString_StackRefSteal(
|
|||
goto cleanup;
|
||||
}
|
||||
res = _PyUnicode_JoinArray(&_Py_STR(empty), args_o, total_args);
|
||||
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
|
||||
assert((res != NULL) ^ (PyErr_Occurred() != NULL));
|
||||
cleanup:
|
||||
// arguments is a pointer into the GC visible stack,
|
||||
// so we must NULL out values as we clear them.
|
||||
|
|
@ -1239,8 +1241,6 @@ _Py_BuildString_StackRefSteal(
|
|||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PyObject *
|
||||
_Py_BuildMap_StackRefSteal(
|
||||
_PyStackRef *arguments,
|
||||
|
|
@ -1257,6 +1257,8 @@ _Py_BuildMap_StackRefSteal(
|
|||
args_o+1, 2,
|
||||
half_args
|
||||
);
|
||||
STACKREFS_TO_PYOBJECTS_CLEANUP(args_o);
|
||||
assert((res != NULL) ^ (PyErr_Occurred() != NULL));
|
||||
cleanup:
|
||||
// arguments is a pointer into the GC visible stack,
|
||||
// so we must NULL out values as we clear them.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue