bpo-40061: Fix a possible refleak in _asynciomodule.c (GH-19748)
tup should be decrefed in the unlikely event of a PyList_New() failure.
This commit is contained in:
parent
735d902b36
commit
7b78e7f9fd
|
@ -710,6 +710,7 @@ future_add_done_callback(FutureObj *fut, PyObject *arg, PyObject *ctx)
|
||||||
else {
|
else {
|
||||||
fut->fut_callbacks = PyList_New(1);
|
fut->fut_callbacks = PyList_New(1);
|
||||||
if (fut->fut_callbacks == NULL) {
|
if (fut->fut_callbacks == NULL) {
|
||||||
|
Py_DECREF(tup);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue