[Python-3000-checkins] r56959 - python/branches/py3k/Modules/posixmodule.c

neal.norwitz python-3000-checkins at python.org
Sun Aug 12 19:09:36 CEST 2007


Author: neal.norwitz
Date: Sun Aug 12 19:09:36 2007
New Revision: 56959

Modified:
   python/branches/py3k/Modules/posixmodule.c
Log:
Fix memory leak in an error condition

Modified: python/branches/py3k/Modules/posixmodule.c
==============================================================================
--- python/branches/py3k/Modules/posixmodule.c	(original)
+++ python/branches/py3k/Modules/posixmodule.c	Sun Aug 12 19:09:36 2007
@@ -4293,7 +4293,10 @@
 				Py_FileSystemDefaultEncoding, &path))
 		return NULL;
 	v = PySequence_GetItem(args, 0);
-	if (v == NULL) return NULL;
+	if (v == NULL) {
+		PyMem_Free(path);
+		return NULL;
+	}
 
 	if (PyUnicode_Check(v)) {
 		arg_is_unicode = 1;


More information about the Python-3000-checkins mailing list