From fca70054c5704535f38dd780821bb1482c01eb1e Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Sun, 12 Aug 2007 16:56:02 +0000 Subject: [PATCH] Fix memory leak --- Modules/posixmodule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index d710a7366e..000f6a2ca3 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; -- 2.50.0