[Python-checkins] r69117 - python/branches/py3k/Python/import.c

hirokazu.yamamoto python-checkins at python.org
Fri Jan 30 04:15:05 CET 2009


Author: hirokazu.yamamoto
Date: Fri Jan 30 04:15:05 2009
New Revision: 69117

Log:
Issue #5041: Fixed memory leak.

Modified:
   python/branches/py3k/Python/import.c

Modified: python/branches/py3k/Python/import.c
==============================================================================
--- python/branches/py3k/Python/import.c	(original)
+++ python/branches/py3k/Python/import.c	Fri Jan 30 04:15:05 2009
@@ -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 *


More information about the Python-checkins mailing list