diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-09-19 09:55:44 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-09-19 09:55:44 (GMT) |
commit | 26c03bd7d5892e6bd7304231c8f10955a73c854d (patch) | |
tree | adf1d1d3450fe4e2d3a71db078cf9528715545d4 | |
parent | 286987bbac8e6138c270ae8863f29a26d38ac977 (diff) | |
download | cpython-26c03bd7d5892e6bd7304231c8f10955a73c854d.zip cpython-26c03bd7d5892e6bd7304231c8f10955a73c854d.tar.gz cpython-26c03bd7d5892e6bd7304231c8f10955a73c854d.tar.bz2 |
Fix memory leak in path_converter()
Issue #28200: Replace PyUnicode_AsWideCharString() with
PyUnicode_AsUnicodeAndSize().
-rw-r--r-- | Misc/NEWS | 3 | ||||
-rw-r--r-- | Modules/posixmodule.c | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -29,6 +29,9 @@ Core and Builtins Library ------- +- Issue #28200: Fix memory leak on Windows in the os module (fix + path_converter() function). + - Issue #25400: RobotFileParser now correctly returns default values for crawl_delay and request_rate. Initial patch by Peter Wirtz. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index ba54249..470ee92 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -920,7 +920,7 @@ path_converter(PyObject *o, void *p) if (is_unicode) { #ifdef MS_WINDOWS - wide = PyUnicode_AsWideCharString(o, &length); + wide = PyUnicode_AsUnicodeAndSize(o, &length); if (!wide) { goto exit; } |