This should fix a mem leak on the Mac. Brett tested it.

This commit is contained in:
Neal Norwitz 2006-01-23 07:25:29 +00:00
parent ffa6f3d942
commit 8ac83f3152
1 changed files with 3 additions and 4 deletions

View File

@ -3204,11 +3204,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 */