mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix unicode_adjust_maxchar(): catch PyUnicode_New() failure
This commit is contained in:
parent
184252ad3f
commit
ca439eecea
1 changed files with 2 additions and 1 deletions
|
@ -2084,7 +2084,8 @@ unicode_adjust_maxchar(PyObject **p_unicode)
|
|||
return;
|
||||
}
|
||||
copy = PyUnicode_New(len, max_char);
|
||||
_PyUnicode_FastCopyCharacters(copy, 0, unicode, 0, len);
|
||||
if (copy != NULL)
|
||||
_PyUnicode_FastCopyCharacters(copy, 0, unicode, 0, len);
|
||||
Py_DECREF(unicode);
|
||||
*p_unicode = copy;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue