PyBaseExceptionObject *self;
self = (PyBaseExceptionObject *)type->tp_alloc(type, 0);
+ if (!self)
+ return NULL;
/* the dict is created on the fly in PyObject_GenericSetAttr */
self->message = self->dict = NULL;
a->ob_digit[size_a-1] < b->ob_digit[size_b-1])) {
/* |a| < |b|. */
*pdiv = _PyLong_New(0);
+ if (*pdiv == NULL)
+ return -1;
Py_INCREF(a);
*prem = (PyLongObject *) a;
return 0;
if (z == NULL)
return -1;
*prem = (PyLongObject *) PyLong_FromLong((long)rem);
+ if (*prem == NULL) {
+ Py_DECREF(z);
+ return -1;
+ }
}
else {
z = x_divrem(a, b, prem);
{
if (PyInt_Check(*pw)) {
*pw = PyLong_FromLong(PyInt_AS_LONG(*pw));
+ if (*pw == NULL)
+ return -1;
Py_INCREF(*pv);
return 0;
}