[Python-checkins] python/dist/src/Modules posixmodule.c,2.244,2.245

Neal Norwitz neal@metaslash.com
Sun, 28 Jul 2002 12:39:26 -0400


loewis@users.sourceforge.net wrote:

> +       if (!PyArg_ParseTuple(args, "etii:lchown",
> +                             Py_FileSystemDefaultEncoding, &path,
> +                             &uid, &gid))
> +               return NULL;
> +       Py_BEGIN_ALLOW_THREADS
> +       res = lchown(path, (uid_t) uid, (gid_t) gid);
> +       Py_END_ALLOW_THREADS
> +       if (res < 0)
> +               return posix_error_with_allocated_filename(path);
> +       PyMem_Free(path);

Is this a memory leak (of path) if res < 0 ?

Neal