char *terminator;
terminator_len = PyString_Size(self->dialect->lineterminator);
+ if (terminator_len == -1)
+ return 0;
/* grow record buffer if necessary */
if (!join_check_rec_size(self, self->rec_len + terminator_len))
if (attrib != Py_None) {
- if (element_new_extra(self, attrib) < 0)
+ if (element_new_extra(self, attrib) < 0) {
+ PyObject_Del(self);
return NULL;
+ }
self->extra->length = 0;
self->extra->allocated = STATIC_CHILDREN;
int sockstate;
self = PyObject_New(PySSLObject, &PySSL_Type); /* Create new object */
- if (self == NULL){
- errstr = "newPySSLObject error";
- goto fail;
+ if (self == NULL) {
+ PyErr_SetString(PySSLErrorObject, "newPySSLObject error");
+ return NULL;
}
memset(self->server, '\0', sizeof(char) * X509_NAME_MAXLEN);
memset(self->issuer, '\0', sizeof(char) * X509_NAME_MAXLEN);
PyLongObject *
_PyLong_New(Py_ssize_t size)
{
- if (size > INT_MAX) {
- /* XXX: Fix this check when ob_size becomes ssize_t */
+ if (size > PY_SSIZE_T_MAX) {
PyErr_NoMemory();
return NULL;
}
assert(size_w == ABS(w->ob_size)); /* That's how d was calculated */
size_v = ABS(v->ob_size);
- a = _PyLong_New(size_v - size_w + 1);
+ k = size_v - size_w;
+ a = _PyLong_New(k + 1);
- for (j = size_v, k = a->ob_size-1; a != NULL && k >= 0; --j, --k) {
+ for (j = size_v; a != NULL && k >= 0; --j, --k) {
digit vj = (j >= size_v) ? 0 : v->ob_digit[j];
twodigits q;
stwodigits carry = 0;