]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #17051: Fix a memory leak in os.path.isdir() on Windows. Patch by Robert Xiao.
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 28 Jan 2013 18:19:50 +0000 (20:19 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Mon, 28 Jan 2013 18:19:50 +0000 (20:19 +0200)
Misc/NEWS
Modules/posixmodule.c

index cd1667022287ba5b4de5537795175ec03b3f00a4..31c4a8a6c82445e2171dfbdc0c4c2d50f4ac333e 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -200,6 +200,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #17051: Fix a memory leak in os.path.isdir() on Windows. Patch by
+  Robert Xiao.
+
 - Issue #9290: In IDLE the sys.std* streams now implement io.TextIOBase
   interface and support all mandatory methods and properties.
 
index d2742a0ee15dc5c68e9726e85d377d6755217b3f..776c7c6fb661ce367245284dc0008995412d7850 100644 (file)
@@ -4229,6 +4229,7 @@ posix__isdir(PyObject *self, PyObject *args)
         return NULL;
 
     attributes = GetFileAttributesA(path);
+    PyMem_Free(path);
     if (attributes == INVALID_FILE_ATTRIBUTES)
         Py_RETURN_FALSE;