Skip to content

Commit 825e91b

Browse files
bpo-38823: Clean up refleaks in _asyncio initialization. (GH-17195)
https://bugs.python.org/issue38823 (cherry picked from commit c3f6bdc) Co-authored-by: Brandt Bucher <[email protected]>
1 parent 5469bc0 commit 825e91b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Modules/_asynciomodule.c

+4
Original file line numberDiff line numberDiff line change
@@ -3361,24 +3361,28 @@ PyInit__asyncio(void)
33613361
Py_INCREF(&FutureType);
33623362
if (PyModule_AddObject(m, "Future", (PyObject *)&FutureType) < 0) {
33633363
Py_DECREF(&FutureType);
3364+
Py_DECREF(m);
33643365
return NULL;
33653366
}
33663367

33673368
Py_INCREF(&TaskType);
33683369
if (PyModule_AddObject(m, "Task", (PyObject *)&TaskType) < 0) {
33693370
Py_DECREF(&TaskType);
3371+
Py_DECREF(m);
33703372
return NULL;
33713373
}
33723374

33733375
Py_INCREF(all_tasks);
33743376
if (PyModule_AddObject(m, "_all_tasks", all_tasks) < 0) {
33753377
Py_DECREF(all_tasks);
3378+
Py_DECREF(m);
33763379
return NULL;
33773380
}
33783381

33793382
Py_INCREF(current_tasks);
33803383
if (PyModule_AddObject(m, "_current_tasks", current_tasks) < 0) {
33813384
Py_DECREF(current_tasks);
3385+
Py_DECREF(m);
33823386
return NULL;
33833387
}
33843388

0 commit comments

Comments
 (0)