diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-01-25 05:43:53 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-01-25 05:43:53 (GMT) |
commit | b9ab8348300edf3e0854fa0b56d51ebcb453f7a0 (patch) | |
tree | e36cbfef3bf684b383bdc043e5db63be78bb9246 | |
parent | ebf1dcaeaf04fc28b322ca641caee752ea5e633e (diff) | |
download | cpython-b9ab8348300edf3e0854fa0b56d51ebcb453f7a0.zip cpython-b9ab8348300edf3e0854fa0b56d51ebcb453f7a0.tar.gz cpython-b9ab8348300edf3e0854fa0b56d51ebcb453f7a0.tar.bz2 |
Backport:
mwh pointed out _Filemodule.c is generated. So to fix the memory leak
this file (the source) must be fixed.
-rw-r--r-- | Mac/Modules/file/filesupport.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Mac/Modules/file/filesupport.py b/Mac/Modules/file/filesupport.py index dac706d..50c1d8a 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 */ |