summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-01-30 03:15:05 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-01-30 03:15:05 (GMT)
commit90eaaf623a7143153fd6d1b9f917b394c923a14a (patch)
tree7a8f2b98af13ccc707175a9f86bf6f762893c21c /Python
parent5276c6417d5df0ad7c92ffe9992b24d6b3e8982a (diff)
downloadcpython-90eaaf623a7143153fd6d1b9f917b394c923a14a.zip
cpython-90eaaf623a7143153fd6d1b9f917b394c923a14a.tar.gz
cpython-90eaaf623a7143153fd6d1b9f917b394c923a14a.tar.bz2
Issue #5041: Fixed memory leak.
Diffstat (limited to 'Python')
-rw-r--r--Python/import.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/import.c b/Python/import.c
index 37e3f4b..d741aca 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -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 *