]> granicus.if.org Git - python/commitdiff
Issue #5041: Fixed memory leak.
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Fri, 30 Jan 2009 03:15:05 +0000 (03:15 +0000)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Fri, 30 Jan 2009 03:15:05 +0000 (03:15 +0000)
Python/import.c

index 37e3f4b5984190d66e719b17d49ddbb0586ff0e7..d741acae6b9666edc20a6947f6b313b76a2108bc 100644 (file)
@@ -2894,12 +2894,14 @@ static PyObject *
 imp_find_module(PyObject *self, PyObject *args)
 {
        char *name;
-       PyObject *path = NULL;
+       PyObject *ret, *path = NULL;
        if (!PyArg_ParseTuple(args, "es|O:find_module",
                              Py_FileSystemDefaultEncoding, &name,
                              &path))
                return NULL;
-       return call_find_module(name, path);
+       ret = call_find_module(name, path);
+       PyMem_Free(name);
+       return ret;
 }
 
 static PyObject *