From 7b78e7f9fd77bb3280ee39fb74b86772a7d46a70 Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Sat, 30 May 2020 02:22:02 -0600 Subject: [PATCH] bpo-40061: Fix a possible refleak in _asynciomodule.c (GH-19748) tup should be decrefed in the unlikely event of a PyList_New() failure. --- Modules/_asynciomodule.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 0608c40f6c3..0454f9c6824 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -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; }