Commit d5af0a5d authored by Victor Stinner's avatar Victor Stinner

PyUnicode_DecodeFSDefaultAndSize() raises MemoryError if _Py_char2wchar() fails

parent 19de4c3a
......@@ -1811,7 +1811,7 @@ PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
wchar = _Py_char2wchar(s, &len);
if (wchar == NULL)
return NULL;
return PyErr_NoMemory();
unicode = PyUnicode_FromWideChar(wchar, len);
PyMem_Free(wchar);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment