From: Neal Norwitz Date: Sun, 12 Aug 2007 16:56:02 +0000 (+0000) Subject: Fix memory leak X-Git-Tag: v3.0a1~427 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fca70054c5704535f38dd780821bb1482c01eb1e;p=thirdparty%2FPython%2Fcpython.git Fix memory leak --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index d710a7366e44..000f6a2ca345 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -4304,8 +4304,9 @@ posix_readlink(PyObject *self, PyObject *args) n = readlink(path, buf, (int) sizeof buf); Py_END_ALLOW_THREADS if (n < 0) - return posix_error_with_filename(path); + return posix_error_with_allocated_filename(path); + PyMem_Free(path); v = PyString_FromStringAndSize(buf, n); if (arg_is_unicode) { PyObject *w;