summaryrefslogtreecommitdiff
path: root/Mac
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-01-23 07:25:29 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2006-01-23 07:25:29 +0000
commit41b398224e8ac7f1011068c3746194f338db5698 (patch)
tree530fc5e469c7a63ce1eacbbd1c8b4e56d7bdda0b /Mac
parent1a2500ac15ac096c4002ac09088437ad9c8d6d6d (diff)
downloadcpython-41b398224e8ac7f1011068c3746194f338db5698.tar.gz
This should fix a mem leak on the Mac. Brett tested it.
Diffstat (limited to 'Mac')
-rw-r--r--Mac/Modules/file/_Filemodule.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Mac/Modules/file/_Filemodule.c b/Mac/Modules/file/_Filemodule.c
index 36ef03ce9c..81f0c02ee0 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 */