[Python-checkins] bpo-40137: Fix refleak in _functools_exec() (GH-24006)

vstinner webhook-mailer at python.org
Tue Dec 29 20:24:55 EST 2020


https://github.com/python/cpython/commit/ba0e49a4648e727d1a16b3ce479499eb39f22311
commit: ba0e49a4648e727d1a16b3ce479499eb39f22311
branch: master
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2020-12-30T02:24:43+01:00
summary:

bpo-40137: Fix refleak in _functools_exec() (GH-24006)

files:
M Modules/_functoolsmodule.c

diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c
index b121ec7d14113..1fcaf299e67bc 100644
--- a/Modules/_functoolsmodule.c
+++ b/Modules/_functoolsmodule.c
@@ -1436,6 +1436,7 @@ _functools_exec(PyObject *module)
         Py_DECREF(lru_cache_type);
         return -1;
     }
+    Py_DECREF(lru_cache_type);
 
     state->keyobject_type = (PyTypeObject *)PyType_FromModuleAndSpec(module,
         &keyobject_type_spec, NULL);



More information about the Python-checkins mailing list