[Python-checkins] r43693 - python/trunk/Modules/_ctypes/callproc.c

neal.norwitz python-checkins at python.org
Thu Apr 6 10:06:53 CEST 2006


Author: neal.norwitz
Date: Thu Apr  6 10:06:52 2006
New Revision: 43693

Modified:
   python/trunk/Modules/_ctypes/callproc.c
Log:
Handle error conditions from PyString_ConcatAndDel().


Modified: python/trunk/Modules/_ctypes/callproc.c
==============================================================================
--- python/trunk/Modules/_ctypes/callproc.c	(original)
+++ python/trunk/Modules/_ctypes/callproc.c	Thu Apr  6 10:06:52 2006
@@ -767,6 +767,8 @@
 	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 @@
 	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);
 }
 
 


More information about the Python-checkins mailing list