Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0e4a5e9

Browse files
[3.8]bpo-40559: Add Py_DECREF to _asynciomodule.c:task_step_impl() (GH-19990)
This fixes a possible memory leak in the C implementation ofasyncio.Task.(cherry picked from commitd2c349b)Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
1 parentbce4dda commit0e4a5e9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix possible memory leak in the C implementation of:class:`asyncio.Task`.

‎Modules/_asynciomodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2626,6 +2626,10 @@ task_step_impl(TaskObj *task, PyObject *exc)
26262626
coro=task->task_coro;
26272627
if (coro==NULL) {
26282628
PyErr_SetString(PyExc_RuntimeError,"uninitialized Task object");
2629+
if (clear_exc) {
2630+
/* We created 'exc' during this call */
2631+
Py_DECREF(exc);
2632+
}
26292633
returnNULL;
26302634
}
26312635

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp