Mercurial > cpython-lru_cache-weakref
diff Python/import.c @ 51197:359394b63a23 3.0
Merged revisions 69117 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r69117 | hirokazu.yamamoto | 2009-01-30 12:15:05 +0900 | 1 line
Issue #5041: Fixed memory leak.
........
| author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> |
|---|---|
| date | Fri, 30 Jan 2009 11:05:53 +0000 |
| parents | e987e0df8f48 |
| children | 87fbbf22adf3 |
line wrap: on
line diff
--- a/Python/import.c Fri Jan 30 04:03:25 2009 +0000 +++ b/Python/import.c Fri Jan 30 11:05:53 2009 +0000 @@ -2894,12 +2894,14 @@ 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 *
