aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-01-25 05:43:53 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2006-01-25 05:43:53 +0000
commitb9ab8348300edf3e0854fa0b56d51ebcb453f7a0 (patch)
treee36cbfef3bf684b383bdc043e5db63be78bb9246 /Mac/Modules
parentBackport: (diff)
downloadcpython-b9ab8348300edf3e0854fa0b56d51ebcb453f7a0.tar.gz
cpython-b9ab8348300edf3e0854fa0b56d51ebcb453f7a0.tar.bz2
cpython-b9ab8348300edf3e0854fa0b56d51ebcb453f7a0.zip
Backport:
mwh pointed out _Filemodule.c is generated. So to fix the memory leak this file (the source) must be fixed.
Diffstat (limited to 'Mac/Modules')
-rw-r--r--Mac/Modules/file/filesupport.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Mac/Modules/file/filesupport.py b/Mac/Modules/file/filesupport.py
index dac706dae05..50c1d8ae007 100644
--- a/Mac/Modules/file/filesupport.py
+++ b/Mac/Modules/file/filesupport.py
@@ -255,11 +255,10 @@ PyMac_GetFSRef(PyObject *v, FSRef *fsr)
char *path = NULL;
if (!PyArg_Parse(v, "et", Py_FileSystemDefaultEncoding, &path))
return NULL;
- 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 */