From: Zackery Spytz Date: Sat, 30 May 2020 08:22:02 +0000 (-0600) Subject: bpo-40061: Fix a possible refleak in _asynciomodule.c (GH-19748) X-Git-Tag: v3.10.0a1~765 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7b78e7f9fd77bb3280ee39fb74b86772a7d46a70;p=thirdparty%2FPython%2Fcpython.git bpo-40061: Fix a possible refleak in _asynciomodule.c (GH-19748) tup should be decrefed in the unlikely event of a PyList_New() failure. --- diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 0608c40f6c33..0454f9c6824b 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; }