From 00dd94dba183a1dd9f97ad1c7d515b094f59ced7 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 10 Sep 2008 18:10:16 +0200 Subject: [PATCH] missing decref in __Pyx_ImportType() --- Cython/Compiler/ModuleNode.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index b772c2c5..6df6b32a 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -2010,6 +2010,9 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); + py_name = 0; + Py_DECREF(py_module); + py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { @@ -2026,6 +2029,7 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class } return (PyTypeObject *)result; bad: + Py_XDECREF(py_module); Py_XDECREF(result); return 0; } -- 2.26.2