Fix memory leak in path_converter()

Issue #28200: Replace PyUnicode_AsWideCharString() with
PyUnicode_AsUnicodeAndSize().
This commit is contained in:
Victor Stinner 2016-09-19 11:55:44 +02:00
parent 286987bbac
commit 26c03bd7d5
2 changed files with 4 additions and 1 deletions

View file

@ -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;
}