if (_PyBytes_Resize(&rv,
(ascii_data -
(unsigned char *)PyBytes_AS_STRING(rv))) < 0) {
- Py_DECREF(rv);
- rv = NULL;
+ Py_CLEAR(rv);
}
PyBuffer_Release(&pbin);
return rv;
*/
if (bin_len > 0) {
if (_PyBytes_Resize(&rv, bin_len) < 0) {
- Py_DECREF(rv);
- rv = NULL;
+ Py_CLEAR(rv);
}
}
else {
if (_PyBytes_Resize(&rv,
(ascii_data -
(unsigned char *)PyBytes_AS_STRING(rv))) < 0) {
- Py_DECREF(rv);
- rv = NULL;
+ Py_CLEAR(rv);
}
PyBuffer_Release(&pbuf);
return rv;
if (_PyBytes_Resize(&rv,
(bin_data -
(unsigned char *)PyBytes_AS_STRING(rv))) < 0) {
- Py_DECREF(rv);
- rv = NULL;
+ Py_CLEAR(rv);
}
if (rv) {
PyObject *rrv = Py_BuildValue("Oi", rv, done);
if (_PyBytes_Resize(&rv,
(out_data -
(unsigned char *)PyBytes_AS_STRING(rv))) < 0) {
- Py_DECREF(rv);
- rv = NULL;
+ Py_CLEAR(rv);
}
PyBuffer_Release(&pbuf);
return rv;
if (_PyBytes_Resize(&rv,
(ascii_data -
(unsigned char *)PyBytes_AS_STRING(rv))) < 0) {
- Py_DECREF(rv);
- rv = NULL;
+ Py_CLEAR(rv);
}
PyBuffer_Release(&pbin);
return rv;
if ( --out_len_left < 0 ) { \
if ( out_len > PY_SSIZE_T_MAX / 2) return PyErr_NoMemory(); \
if (_PyBytes_Resize(&rv, 2*out_len) < 0) \
- { Py_DECREF(rv); PyBuffer_Release(&pin); return NULL; } \
+ { Py_XDECREF(rv); PyBuffer_Release(&pin); return NULL; } \
out_data = (unsigned char *)PyBytes_AS_STRING(rv) \
+ out_len; \
out_len_left = out_len-1; \
if (_PyBytes_Resize(&rv,
(out_data -
(unsigned char *)PyBytes_AS_STRING(rv))) < 0) {
- Py_DECREF(rv);
- rv = NULL;
+ Py_CLEAR(rv);
}
PyBuffer_Release(&pin);
return rv;
so extend the output buffer and try again */
while (err == Z_OK && self->zst.avail_out == 0) {
if (_PyBytes_Resize(&RetVal, length << 1) < 0) {
- Py_DECREF(RetVal);
- RetVal = NULL;
+ Py_CLEAR(RetVal);
goto error;
}
self->zst.next_out =
goto error;
}
if (_PyBytes_Resize(&RetVal, self->zst.total_out - start_total_out) < 0) {
- Py_DECREF(RetVal);
- RetVal = NULL;
+ Py_CLEAR(RetVal);
}
error:
length = max_length;
if (_PyBytes_Resize(&RetVal, length) < 0) {
- Py_DECREF(RetVal);
- RetVal = NULL;
+ Py_CLEAR(RetVal);
goto error;
}
self->zst.next_out =
}
if (_PyBytes_Resize(&RetVal, self->zst.total_out - start_total_out) < 0) {
- Py_DECREF(RetVal);
- RetVal = NULL;
+ Py_CLEAR(RetVal);
}
error:
so extend the output buffer and try again */
while (err == Z_OK && self->zst.avail_out == 0) {
if (_PyBytes_Resize(&RetVal, length << 1) < 0) {
- Py_DECREF(RetVal);
- RetVal = NULL;
+ Py_CLEAR(RetVal);
goto error;
}
self->zst.next_out =
}
if (_PyBytes_Resize(&RetVal, self->zst.total_out - start_total_out) < 0) {
- Py_DECREF(RetVal);
- RetVal = NULL;
+ Py_CLEAR(RetVal);
}
error:
so extend the output buffer and try again */
while ((err == Z_OK || err == Z_BUF_ERROR) && self->zst.avail_out == 0) {
if (_PyBytes_Resize(&retval, length << 1) < 0) {
- Py_DECREF(retval);
- retval = NULL;
+ Py_CLEAR(retval);
goto error;
}
self->zst.next_out = (Byte *)PyBytes_AS_STRING(retval) + length;
}
if (_PyBytes_Resize(&retval, self->zst.total_out - start_total_out) < 0) {
- Py_DECREF(retval);
- retval = NULL;
+ Py_CLEAR(retval);
}
error: