Fix missing decref in __Pyx_ImportModule
authorRobert Bradshaw <robertwb@math.washington.edu>
Sun, 28 Oct 2007 09:31:53 +0000 (02:31 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sun, 28 Oct 2007 09:31:53 +0000 (02:31 -0700)
Cython/Compiler/ModuleNode.py

index 74708b2439bd53ee512e68ac9e6135daa9476a15..84f5af045dfdd15737969bf72874c957c4fd4fdd 100644 (file)
@@ -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;