[Python-checkins] cpython (2.7): Issue #17051: Fix a memory leak in os.path.isdir() on Windows. Patch by Robert

serhiy.storchaka python-checkins at python.org
Mon Jan 28 19:22:50 CET 2013


http://hg.python.org/cpython/rev/4deb294ff567
changeset:   81794:4deb294ff567
branch:      2.7
parent:      81790:af354c518b86
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Mon Jan 28 20:19:50 2013 +0200
summary:
  Issue #17051: Fix a memory leak in os.path.isdir() on Windows. Patch by Robert Xiao.

files:
  Misc/NEWS             |  3 +++
  Modules/posixmodule.c |  1 +
  2 files changed, 4 insertions(+), 0 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -200,6 +200,9 @@
 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.
 
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -4229,6 +4229,7 @@
         return NULL;
 
     attributes = GetFileAttributesA(path);
+    PyMem_Free(path);
     if (attributes == INVALID_FILE_ATTRIBUTES)
         Py_RETURN_FALSE;
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list