mirror of
https://github.com/python/cpython.git
synced 2025-11-03 19:34:08 +00:00
Issue #5041: Fixed memory leak.
This commit is contained in:
parent
5276c6417d
commit
90eaaf623a
1 changed files with 4 additions and 2 deletions
|
|
@ -2894,12 +2894,14 @@ static PyObject *
|
||||||
imp_find_module(PyObject *self, PyObject *args)
|
imp_find_module(PyObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
PyObject *path = NULL;
|
PyObject *ret, *path = NULL;
|
||||||
if (!PyArg_ParseTuple(args, "es|O:find_module",
|
if (!PyArg_ParseTuple(args, "es|O:find_module",
|
||||||
Py_FileSystemDefaultEncoding, &name,
|
Py_FileSystemDefaultEncoding, &name,
|
||||||
&path))
|
&path))
|
||||||
return NULL;
|
return NULL;
|
||||||
return call_find_module(name, path);
|
ret = call_find_module(name, path);
|
||||||
|
PyMem_Free(name);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue