summaryrefslogtreecommitdiffstats
path: root/Modules/_asynciomodule.c
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2020-05-30 08:22:02 (GMT)
committerGitHub <noreply@github.com>2020-05-30 08:22:02 (GMT)
commit7b78e7f9fd77bb3280ee39fb74b86772a7d46a70 (patch)
tree9616312cf48a743736d7fdfa89406e93db9c1c4e /Modules/_asynciomodule.c
parent735d902b363b759df9ff00e58bbf4f7e2bde78cd (diff)
downloadcpython-7b78e7f9fd77bb3280ee39fb74b86772a7d46a70.zip
cpython-7b78e7f9fd77bb3280ee39fb74b86772a7d46a70.tar.gz
cpython-7b78e7f9fd77bb3280ee39fb74b86772a7d46a70.tar.bz2
bpo-40061: Fix a possible refleak in _asynciomodule.c (GH-19748)
tup should be decrefed in the unlikely event of a PyList_New() failure.
Diffstat (limited to 'Modules/_asynciomodule.c')
-rw-r--r--Modules/_asynciomodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c
index 0608c40..0454f9c 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;
}