]> granicus.if.org Git - python/commitdiff
Issue #17968: Fix memory leak in os.listxattr().
authorAntoine Pitrou <solipsis@pitrou.net>
Mon, 13 May 2013 17:48:46 +0000 (19:48 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Mon, 13 May 2013 17:48:46 +0000 (19:48 +0200)
1  2 
Misc/NEWS
Modules/posixmodule.c

diff --cc Misc/NEWS
Simple merge
index 1149856e3055db01103d5ec61cd535d97936e027,3e5e58045fdcd0fd5f22c27742d4cfc945389281..8e84392d5ca85e1a4d6b745304bc0cbc7d427317
@@@ -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;
          }