mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
bpo-45262, asyncio: Fix cache of the running loop holder (GH-28796)
Prevent use-after-free of running loop holder via cache.
(cherry picked from commit 392a898353
)
Co-authored-by: Matthias Reichl <github@hias.horus.com>
This commit is contained in:
parent
06935bd68e
commit
87f0156a22
2 changed files with 4 additions and 0 deletions
|
@ -3258,6 +3258,9 @@ new_running_loop_holder(PyObject *loop)
|
|||
static void
|
||||
PyRunningLoopHolder_tp_dealloc(PyRunningLoopHolder *rl)
|
||||
{
|
||||
if (cached_running_holder == (PyObject *)rl) {
|
||||
cached_running_holder = NULL;
|
||||
}
|
||||
Py_CLEAR(rl->rl_loop);
|
||||
PyObject_Free(rl);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue