diff --git a/Mac/Modules/file/filesupport.py b/Mac/Modules/file/filesupport.py index d0e88f016f1..f2d419328b2 100644 --- a/Mac/Modules/file/filesupport.py +++ b/Mac/Modules/file/filesupport.py @@ -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 */