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:
Zackery Spytz 2020-05-30 02:22:02 -06:00 committed by GitHub
parent 735d902b36
commit 7b78e7f9fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -710,6 +710,7 @@ future_add_done_callback(FutureObj *fut, PyObject *arg, PyObject *ctx)
else {
fut->fut_callbacks = PyList_New(1);
if (fut->fut_callbacks == NULL) {
Py_DECREF(tup);
return NULL;
}