Commit ca439eec authored by Victor Stinner's avatar Victor Stinner

Fix unicode_adjust_maxchar(): catch PyUnicode_New() failure

parent 184252ad
......@@ -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;
}
......
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