Skip to content

Commit 7b78e7f

Browse files
authored
bpo-40061: Fix a possible refleak in _asynciomodule.c (GH-19748)
tup should be decrefed in the unlikely event of a PyList_New() failure.
1 parent 735d902 commit 7b78e7f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/_asynciomodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@ future_add_done_callback(FutureObj *fut, PyObject *arg, PyObject *ctx)
710710
else {
711711
fut->fut_callbacks = PyList_New(1);
712712
if (fut->fut_callbacks == NULL) {
713+
Py_DECREF(tup);
713714
return NULL;
714715
}
715716

0 commit comments

Comments
 (0)