_PyUnicode_FromId() may return NULL.
Reported by coverity scan: CID
1426868,
1426867.
if (errors == Py_None) {
errors = _PyUnicode_FromId(&PyId_strict); /* borrowed */
+ if (errors == NULL) {
+ return -1;
+ }
}
else if (!PyUnicode_Check(errors)) {
// Check 'errors' argument here because Argument Clinic doesn't support
}
else if (errors == Py_None) {
errors = _PyUnicode_FromId(&PyId_strict);
+ if (errors == NULL) {
+ return -1;
+ }
}
const char *c_errors = PyUnicode_AsUTF8(errors);