From 2e77c5d3e346eb5236dd6fe75dae689df036dde8 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Sun, 28 Oct 2007 02:31:53 -0700 Subject: [PATCH] Fix missing decref in __Pyx_ImportModule --- Cython/Compiler/ModuleNode.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 74708b24..84f5af04 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -1596,11 +1596,14 @@ static PyObject *__Pyx_ImportModule(char *name); /*proto*/ #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(char *name) { PyObject *py_name = 0; + PyObject *py_module = 0; py_name = PyString_FromString(name); if (!py_name) goto bad; - return PyImport_Import(py_name); + py_module = PyImport_Import(py_name); + Py_DECREF(py_name); + return py_module; bad: Py_XDECREF(py_name); return 0; -- 2.26.2