From 90eaaf623a7143153fd6d1b9f917b394c923a14a Mon Sep 17 00:00:00 2001 From: Hirokazu Yamamoto Date: Fri, 30 Jan 2009 03:15:05 +0000 Subject: [PATCH] Issue #5041: Fixed memory leak. --- Python/import.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Python/import.c b/Python/import.c index 37e3f4b598..d741acae6b 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 * -- 2.40.0