]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport: This should fix a mem leak on the Mac. Brett tested it.
authorNeal Norwitz <nnorwitz@gmail.com>
Mon, 23 Jan 2006 07:37:28 +0000 (07:37 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Mon, 23 Jan 2006 07:37:28 +0000 (07:37 +0000)
Mac/Modules/file/_Filemodule.c

index c1b4310e6e32f8abbd2a6d3f89a472df151cfdb7..7fb1364ae4af88c6cd427b97848994b96eaa66e3 100644 (file)
@@ -3202,9 +3202,9 @@ PyMac_GetFSRef(PyObject *v, FSRef *fsr)
                        return 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 */