Kaydet (Commit) 915ae41b authored tarafından Neal Norwitz's avatar Neal Norwitz

Handle error conditions from PyString_ConcatAndDel().

üst b038333d
...@@ -767,6 +767,8 @@ void Extend_Error_Info(PyObject *exc_class, char *fmt, ...) ...@@ -767,6 +767,8 @@ void Extend_Error_Info(PyObject *exc_class, char *fmt, ...)
if (cls_str) { if (cls_str) {
PyString_ConcatAndDel(&s, cls_str); PyString_ConcatAndDel(&s, cls_str);
PyString_ConcatAndDel(&s, PyString_FromString(": ")); PyString_ConcatAndDel(&s, PyString_FromString(": "));
if (s == NULL)
goto error;
} else } else
PyErr_Clear(); PyErr_Clear();
msg_str = PyObject_Str(v); msg_str = PyObject_Str(v);
...@@ -775,12 +777,15 @@ void Extend_Error_Info(PyObject *exc_class, char *fmt, ...) ...@@ -775,12 +777,15 @@ void Extend_Error_Info(PyObject *exc_class, char *fmt, ...)
else { else {
PyErr_Clear(); PyErr_Clear();
PyString_ConcatAndDel(&s, PyString_FromString("???")); PyString_ConcatAndDel(&s, PyString_FromString("???"));
if (s == NULL)
goto error;
} }
PyErr_SetObject(exc_class, s); PyErr_SetObject(exc_class, s);
error:
Py_XDECREF(tp); Py_XDECREF(tp);
Py_XDECREF(v); Py_XDECREF(v);
Py_XDECREF(tb); Py_XDECREF(tb);
Py_DECREF(s); Py_XDECREF(s);
} }
......
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