PyUnicode_DecodeFSDefaultAndSize() raises MemoryError if _Py_char2wchar() fails

This commit is contained in:
Victor Stinner 2010-11-08 23:34:29 +00:00
parent 19de4c3a8c
commit d5af0a5df0
1 changed files with 1 additions and 1 deletions

View File

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