]> granicus.if.org Git - python/commitdiff
mwh pointed out _Filemodule.c is generated. So to fix the memory leak
authorNeal Norwitz <nnorwitz@gmail.com>
Wed, 25 Jan 2006 05:42:22 +0000 (05:42 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Wed, 25 Jan 2006 05:42:22 +0000 (05:42 +0000)
this file (the source) must be fixed.

Why isn't there a comment at the top saying the file is generated and
why are both the source and generated file checked in?  Bootstrap problem?

Will backport.

Mac/Modules/file/filesupport.py

index d0e88f016f1c2e2376dec35d3f0001d2a6ca02cd..f2d419328b2eff455da7b9acada7346c1da8a368 100644 (file)
@@ -302,11 +302,10 @@ PyMac_GetFSRef(PyObject *v, FSRef *fsr)
                 char *path = NULL;
                 if (!PyArg_Parse(v, "et", Py_FileSystemDefaultEncoding, &path))
                         return 0;
-                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 */