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: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f1879190205088a8dc23acccce142449de6a78f;p=thirdparty%2FPython%2Fcpython.git Issue #17968: Fix memory leak in os.listxattr(). --- 5f1879190205088a8dc23acccce142449de6a78f diff --cc Modules/posixmodule.c index 1149856e3055,3e5e58045fdc..8e84392d5ca8 --- 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; }