[Python-checkins] python/dist/src/Modules posixmodule.c, 2.342, 2.343

birkenfeld@users.sourceforge.net birkenfeld at users.sourceforge.net
Sun Sep 25 08:16:44 CEST 2005


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4118/Modules

Modified Files:
	posixmodule.c 
Log Message:
Commit memory leaking fix.



Index: posixmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.342
retrieving revision 2.343
diff -u -d -r2.342 -r2.343
--- posixmodule.c	19 Sep 2005 06:45:53 -0000	2.342
+++ posixmodule.c	25 Sep 2005 06:16:40 -0000	2.343
@@ -7255,8 +7255,12 @@
 	Py_BEGIN_ALLOW_THREADS
 	rc = ShellExecute((HWND)0, NULL, filepath, NULL, NULL, SW_SHOWNORMAL);
 	Py_END_ALLOW_THREADS
-	if (rc <= (HINSTANCE)32)
-		return win32_error("startfile", filepath);
+	if (rc <= (HINSTANCE)32) {
+		PyObject *errval = win32_error("startfile", filepath);
+		PyMem_Free(filepath);
+		return errval;
+	}
+	PyMem_Free(filepath);
 	Py_INCREF(Py_None);
 	return Py_None;
 }



More information about the Python-checkins mailing list