Commit fca70054 authored by Neal Norwitz's avatar Neal Norwitz

Fix memory leak

parent 72937f32
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment