From: Antoine Pitrou Date: Mon, 13 May 2013 17:48:46 +0000 (+0200) Subject: Issue #17968: Fix memory leak in os.listxattr(). X-Git-Tag: v3.4.0a1~734 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f1879190205088a8dc23acccce142449de6a78f;p=python Issue #17968: Fix memory leak in os.listxattr(). --- 5f1879190205088a8dc23acccce142449de6a78f diff --cc Modules/posixmodule.c index 1149856e30,3e5e58045f..8e84392d5c --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@@ -10119,9 -10625,11 +10119,11 @@@ posix_listxattr(PyObject *self, PyObjec Py_END_ALLOW_THREADS; if (length < 0) { - if (errno == ERANGE) + if (errno == ERANGE) { + PyMem_FREE(buffer); continue; + } - path_error("listxattr", &path); + path_error(&path); break; }