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

Martin v. Löwis loewis@informatik.hu-berlin.de
29 Jul 2002 09:56:27 +0200


Neal Norwitz <neal@metaslash.com> writes:

> > +       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 ?

No, since posix_error_with_allocated_filename releases path.

Regards,
Martin