Commit 18b7df3d authored by Victor Stinner's avatar Victor Stinner

PyUnicode_DecodeFSDefaultAndSize() raises MemoryError if _Py_char2wchar() fails

parent c1045d4f
......@@ -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