Skip to content

Commit c3f6bdc

Browse files
brandtbuchermiss-islington
authored andcommitted
bpo-38823: Clean up refleaks in _asyncio initialization. (GH-17195)
https://bugs.python.org/issue38823
1 parent d0acdfc commit c3f6bdc

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
@@ -3387,24 +3387,28 @@ PyInit__asyncio(void)
33873387
Py_INCREF(&FutureType);
33883388
if (PyModule_AddObject(m, "Future", (PyObject *)&FutureType) < 0) {
33893389
Py_DECREF(&FutureType);
3390+
Py_DECREF(m);
33903391
return NULL;
33913392
}
33923393

33933394
Py_INCREF(&TaskType);
33943395
if (PyModule_AddObject(m, "Task", (PyObject *)&TaskType) < 0) {
33953396
Py_DECREF(&TaskType);
3397+
Py_DECREF(m);
33963398
return NULL;
33973399
}
33983400

33993401
Py_INCREF(all_tasks);
34003402
if (PyModule_AddObject(m, "_all_tasks", all_tasks) < 0) {
34013403
Py_DECREF(all_tasks);
3404+
Py_DECREF(m);
34023405
return NULL;
34033406
}
34043407

34053408
Py_INCREF(current_tasks);
34063409
if (PyModule_AddObject(m, "_current_tasks", current_tasks) < 0) {
34073410
Py_DECREF(current_tasks);
3411+
Py_DECREF(m);
34083412
return NULL;
34093413
}
34103414

0 commit comments

Comments
 (0)