bpo-40071: Fix refleak in _functools module (GH19172)

This commit is contained in:
Paulo Henrique Silva 2020-03-26 09:47:45 -03:00 committed by GitHub
parent 79ceccd1ec
commit b09ae3ff43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -1424,9 +1424,11 @@ _functools_exec(PyObject *module)
&lru_cache_type &lru_cache_type
}; };
kwd_mark = _PyObject_CallNoArg((PyObject *)&PyBaseObject_Type);
if (!kwd_mark) { 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++) { for (size_t i = 0; i < Py_ARRAY_LENGTH(typelist); i++) {