[Python-checkins] r42180 - python/branches/release24-maint/Mac/Modules/file/filesupport.py

neal.norwitz python-checkins at python.org
Wed Jan 25 06:43:54 CET 2006


Author: neal.norwitz
Date: Wed Jan 25 06:43:53 2006
New Revision: 42180

Modified:
   python/branches/release24-maint/Mac/Modules/file/filesupport.py
Log:
Backport:
mwh pointed out _Filemodule.c is generated. So to fix the memory leak
this file (the source) must be fixed.


Modified: python/branches/release24-maint/Mac/Modules/file/filesupport.py
==============================================================================
--- python/branches/release24-maint/Mac/Modules/file/filesupport.py	(original)
+++ python/branches/release24-maint/Mac/Modules/file/filesupport.py	Wed Jan 25 06:43:53 2006
@@ -255,11 +255,10 @@
                 char *path = NULL;
                 if (!PyArg_Parse(v, "et", Py_FileSystemDefaultEncoding, &path))
                         return NULL;
-                if ( (err=FSPathMakeRef(path, fsr, 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