summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-05-13 17:48:46 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-05-13 17:48:46 (GMT)
commit5f1879190205088a8dc23acccce142449de6a78f (patch)
tree504b8caafec44156d0eb231388d0c260cb63751e /Modules
parentf6b687fcd4d62e53443e23376dc02c177fecc0d4 (diff)
parent7f987398b7fa8984ab8aa88acff2b7e1d89e3da7 (diff)
downloadcpython-5f1879190205088a8dc23acccce142449de6a78f.zip
cpython-5f1879190205088a8dc23acccce142449de6a78f.tar.gz
cpython-5f1879190205088a8dc23acccce142449de6a78f.tar.bz2
Issue #17968: Fix memory leak in os.listxattr().
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 1149856..8e84392 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -10119,8 +10119,10 @@ posix_listxattr(PyObject *self, PyObject *args, PyObject *kwargs)
Py_END_ALLOW_THREADS;
if (length < 0) {
- if (errno == ERANGE)
+ if (errno == ERANGE) {
+ PyMem_FREE(buffer);
continue;
+ }
path_error(&path);
break;
}