From: Robert Bradshaw Date: Sun, 28 Oct 2007 09:31:53 +0000 (-0700) Subject: Fix missing decref in __Pyx_ImportModule X-Git-Tag: 0.9.6.14~29^2~107 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2e77c5d3e346eb5236dd6fe75dae689df036dde8;p=cython.git Fix missing decref in __Pyx_ImportModule --- 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;