summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-04-06 08:06:52 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-04-06 08:06:52 (GMT)
commit915ae41b3a614ffceedfe79d2b802e3162943e19 (patch)
tree33d646151a3e37edb442c50825b964224fab6fa5 /Modules
parentb038333d4b1d974d3338b58586480eb5fa676aaf (diff)
downloadcpython-915ae41b3a614ffceedfe79d2b802e3162943e19.zip
cpython-915ae41b3a614ffceedfe79d2b802e3162943e19.tar.gz
cpython-915ae41b3a614ffceedfe79d2b802e3162943e19.tar.bz2
Handle error conditions from PyString_ConcatAndDel().
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/callproc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index a29633e..ed1ece9 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -767,6 +767,8 @@ void Extend_Error_Info(PyObject *exc_class, char *fmt, ...)
if (cls_str) {
PyString_ConcatAndDel(&s, cls_str);
PyString_ConcatAndDel(&s, PyString_FromString(": "));
+ if (s == NULL)
+ goto error;
} else
PyErr_Clear();
msg_str = PyObject_Str(v);
@@ -775,12 +777,15 @@ void Extend_Error_Info(PyObject *exc_class, char *fmt, ...)
else {
PyErr_Clear();
PyString_ConcatAndDel(&s, PyString_FromString("???"));
+ if (s == NULL)
+ goto error;
}
PyErr_SetObject(exc_class, s);
+error:
Py_XDECREF(tp);
Py_XDECREF(v);
Py_XDECREF(tb);
- Py_DECREF(s);
+ Py_XDECREF(s);
}