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

georg.brandl python-3000-checkins at python.org
Sat Jul 19 12:13:16 CEST 2008


Author: georg.brandl
Date: Sat Jul 19 12:13:15 2008
New Revision: 65132

Log:
#3368: free string allocated by "es" ParseTuple format.


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	Sat Jul 19 12:13:15 2008
@@ -3187,6 +3187,7 @@
 
 	pathlen = strlen(path);
 	if (pathlen == 0) {
+		PyMem_Free(path);
 		PyErr_SetString(PyExc_ImportError, "empty pathname");
 		return -1;
 	} else {
@@ -3208,6 +3209,7 @@
 			rv = stat(mangled, &statbuf);
 		}
 #endif
+		PyMem_Free(path);
 		if (rv == 0) {
 			/* it exists */
 			if (S_ISDIR(statbuf.st_mode)) {


More information about the Python-3000-checkins mailing list