This fixes a possible memory leak in the C implementation of
asyncio.Task.
(cherry picked from commit
d2c349b190bcba21a4a38e6520a48ad97a9f1529)
Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
--- /dev/null
+Fix possible memory leak in the C implementation of :class:`asyncio.Task`.
\ No newline at end of file
coro = task->task_coro;
if (coro == NULL) {
PyErr_SetString(PyExc_RuntimeError, "uninitialized Task object");
+ if (clear_exc) {
+ /* We created 'exc' during this call */
+ Py_DECREF(exc);
+ }
return NULL;
}