From: Serhiy Storchaka Date: Mon, 28 Jan 2013 18:19:50 +0000 (+0200) Subject: Issue #17051: Fix a memory leak in os.path.isdir() on Windows. Patch by Robert Xiao. X-Git-Tag: v2.7.4rc1~194 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=46f5b35bc0d680501629f75a86e40ee4b5798ed7;p=thirdparty%2FPython%2Fcpython.git Issue #17051: Fix a memory leak in os.path.isdir() on Windows. Patch by Robert Xiao. --- diff --git a/Misc/NEWS b/Misc/NEWS index cd1667022287..31c4a8a6c824 100644 --- 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. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index d2742a0ee15d..776c7c6fb661 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -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;