From: Paulo Henrique Silva Date: Thu, 26 Mar 2020 12:47:45 +0000 (-0300) Subject: bpo-40071: Fix refleak in _functools module (GH19172) X-Git-Tag: v3.9.0a6~268 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b09ae3ff43111a336c0b706ea32fa07f88c992d9;p=thirdparty%2FPython%2Fcpython.git bpo-40071: Fix refleak in _functools module (GH19172) --- diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 2e27d48b1475..dbe022e91d18 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++) {