Skip to content

Commit b9ab834

Browse files
committed
Backport:
mwh pointed out _Filemodule.c is generated. So to fix the memory leak this file (the source) must be fixed.
1 parent ebf1dca commit b9ab834

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

Mac/Modules/file/filesupport.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,10 @@ def getargsCheck(self, name):
255255
char *path = NULL;
256256
if (!PyArg_Parse(v, "et", Py_FileSystemDefaultEncoding, &path))
257257
return NULL;
258-
if ( (err=FSPathMakeRef(path, fsr, NULL)) ) {
258+
if ( (err=FSPathMakeRef(path, fsr, NULL)) )
259259
PyMac_Error(err);
260-
return 0;
261-
}
262-
return 1;
260+
PyMem_Free(path);
261+
return !err;
263262
}
264263
/* XXXX Should try unicode here too */
265264
/* Otherwise we try to go via an FSSpec */

0 commit comments

Comments
 (0)