From b9ab8348300edf3e0854fa0b56d51ebcb453f7a0 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Wed, 25 Jan 2006 05:43:53 +0000 Subject: Backport: mwh pointed out _Filemodule.c is generated. So to fix the memory leak this file (the source) must be fixed. --- Mac/Modules/file/filesupport.py | 7 +++---- 1 file 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 */ -- cgit v0.12