From: Neal Norwitz Date: Mon, 23 Jan 2006 07:25:29 +0000 (+0000) Subject: This should fix a mem leak on the Mac. Brett tested it. X-Git-Tag: v2.5a0~765 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8ac83f31524ab9214fd25ef307c16e1bf25df745;p=thirdparty%2FPython%2Fcpython.git This should fix a mem leak on the Mac. Brett tested it. --- diff --git a/Mac/Modules/file/_Filemodule.c b/Mac/Modules/file/_Filemodule.c index 36ef03ce9cb5..81f0c02ee0cd 100644 --- a/Mac/Modules/file/_Filemodule.c +++ b/Mac/Modules/file/_Filemodule.c @@ -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 */