mirror of
https://github.com/python/cpython.git
synced 2025-12-07 17:57:56 +00:00
Fix memory leak
This commit is contained in:
parent
72937f3216
commit
fca70054c5
1 changed files with 2 additions and 1 deletions
|
|
@ -4304,8 +4304,9 @@ posix_readlink(PyObject *self, PyObject *args)
|
||||||
n = readlink(path, buf, (int) sizeof buf);
|
n = readlink(path, buf, (int) sizeof buf);
|
||||||
Py_END_ALLOW_THREADS
|
Py_END_ALLOW_THREADS
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
return posix_error_with_filename(path);
|
return posix_error_with_allocated_filename(path);
|
||||||
|
|
||||||
|
PyMem_Free(path);
|
||||||
v = PyString_FromStringAndSize(buf, n);
|
v = PyString_FromStringAndSize(buf, n);
|
||||||
if (arg_is_unicode) {
|
if (arg_is_unicode) {
|
||||||
PyObject *w;
|
PyObject *w;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue