diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-01-25 05:42:22 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-01-25 05:42:22 (GMT) |
commit | 73afe9aa32b8513c6d4c4d0ee24ed87fb64638ec (patch) | |
tree | 2b1a2c845b489585d3a170cd151037fbf2c092fe /Mac | |
parent | 62a21121b4acf9b37ea62e64498a869048fefb5b (diff) | |
download | cpython-73afe9aa32b8513c6d4c4d0ee24ed87fb64638ec.zip cpython-73afe9aa32b8513c6d4c4d0ee24ed87fb64638ec.tar.gz cpython-73afe9aa32b8513c6d4c4d0ee24ed87fb64638ec.tar.bz2 |
mwh pointed out _Filemodule.c is generated. So to fix the memory leak
this file (the source) must be fixed.
Why isn't there a comment at the top saying the file is generated and
why are both the source and generated file checked in? Bootstrap problem?
Will backport.
Diffstat (limited to 'Mac')
-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 d0e88f0..f2d4193 100644 --- a/Mac/Modules/file/filesupport.py +++ b/Mac/Modules/file/filesupport.py @@ -302,11 +302,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 */ |