Commit 67002af3 authored by Victor Stinner's avatar Victor Stinner

Check error when calling PyUnicode_AppendAndDel()

parent 1a15aba7
......@@ -944,9 +944,9 @@ void _ctypes_extend_error(PyObject *exc_class, char *fmt, ...)
else {
PyErr_Clear();
PyUnicode_AppendAndDel(&s, PyUnicode_FromString("???"));
}
if (s == NULL)
goto error;
}
PyErr_SetObject(exc_class, s);
error:
Py_XDECREF(tp);
......
......@@ -248,8 +248,10 @@ dl_funcptr _PyImport_GetDynLoadWindows(const char *shortname,
theInfo,
theLength));
}
if (message != NULL) {
PyErr_SetObject(PyExc_ImportError, message);
Py_XDECREF(message);
Py_DECREF(message);
}
return NULL;
} else {
char buffer[256];
......
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