mirror of
https://github.com/python/cpython.git
synced 2025-07-16 07:45:20 +00:00
PyUnicode_DecodeFSDefaultAndSize() raises MemoryError if _Py_char2wchar() fails
This commit is contained in:
parent
19de4c3a8c
commit
d5af0a5df0
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue