Skip to content

Commit 7aeeb16

Browse files
author
hirokazu.yamamoto
committed
Issue #5041: Fixed memory leak.
git-svn-id: http://svn.python.org/projects/python/branches/py3k@69117 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent edfe9ae commit 7aeeb16

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Python/import.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2894,12 +2894,14 @@ static PyObject *
28942894
imp_find_module(PyObject *self, PyObject *args)
28952895
{
28962896
char *name;
2897-
PyObject *path = NULL;
2897+
PyObject *ret, *path = NULL;
28982898
if (!PyArg_ParseTuple(args, "es|O:find_module",
28992899
Py_FileSystemDefaultEncoding, &name,
29002900
&path))
29012901
return NULL;
2902-
return call_find_module(name, path);
2902+
ret = call_find_module(name, path);
2903+
PyMem_Free(name);
2904+
return ret;
29032905
}
29042906

29052907
static PyObject *

0 commit comments

Comments
 (0)