summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Henrique Silva <ph.silva@carta.com>2020-03-26 12:47:45 (GMT)
committerGitHub <noreply@github.com>2020-03-26 12:47:45 (GMT)
commitb09ae3ff43111a336c0b706ea32fa07f88c992d9 (patch)
tree2363fefab8ef8e5100473869e18b61af2201f3af
parent79ceccd1ec6ef7e487da2916f32c6f0d1477bd3d (diff)
downloadcpython-b09ae3ff43111a336c0b706ea32fa07f88c992d9.zip
cpython-b09ae3ff43111a336c0b706ea32fa07f88c992d9.tar.gz
cpython-b09ae3ff43111a336c0b706ea32fa07f88c992d9.tar.bz2
bpo-40071: Fix refleak in _functools module (GH19172)
-rw-r--r--Modules/_functoolsmodule.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c
index 2e27d48..dbe022e 100644
--- a/Modules/_functoolsmodule.c
+++ b/Modules/_functoolsmodule.c
@@ -1424,9 +1424,11 @@ _functools_exec(PyObject *module)
&lru_cache_type
};
- kwd_mark = _PyObject_CallNoArg((PyObject *)&PyBaseObject_Type);
if (!kwd_mark) {
- return -1;
+ kwd_mark = _PyObject_CallNoArg((PyObject *)&PyBaseObject_Type);
+ if (!kwd_mark) {
+ return -1;
+ }
}
for (size_t i = 0; i < Py_ARRAY_LENGTH(typelist); i++) {