[Python-checkins] r42150 - python/branches/release24-maint/Mac/Modules/file/_Filemodule.c

neal.norwitz python-checkins at python.org
Mon Jan 23 08:37:28 CET 2006


Author: neal.norwitz
Date: Mon Jan 23 08:37:28 2006
New Revision: 42150

Modified:
   python/branches/release24-maint/Mac/Modules/file/_Filemodule.c
Log:
Backport: This should fix a mem leak on the Mac.  Brett tested it.

Modified: python/branches/release24-maint/Mac/Modules/file/_Filemodule.c
==============================================================================
--- python/branches/release24-maint/Mac/Modules/file/_Filemodule.c	(original)
+++ python/branches/release24-maint/Mac/Modules/file/_Filemodule.c	Mon Jan 23 08:37:28 2006
@@ -3202,9 +3202,9 @@
 			return NULL;
 		if ( (err=FSPathMakeRef(path, fsr, NULL)) ) {
 			PyMac_Error(err);
-			return 0;
 		}
-		return 1;
+		PyMem_Free(path);
+		return !err;
 	}
 	/* XXXX Should try unicode here too */
 	/* Otherwise we try to go via an FSSpec */


More information about the Python-checkins mailing list