- if ((rz->stream = calloc(sizeof(z_stream), 1)) == NULL) {
- fprintf(stderr, "[%s] failure to allocate stream buffer.\n", __func__);
- free(rz);
- return NULL;
- }
- if ((rz->inbuf = malloc(RZ_BUFFER_SIZE)) == NULL) {
- fprintf(stderr, "[%s] failure to allocate input buffer.\n", __func__);
- free(rz->stream);
- free(rz);
- return NULL;
- }
- if ((rz->outbuf = malloc(RZ_BUFFER_SIZE)) == NULL) {
- fprintf(stderr, "[%s] failure to allocate output buffer.\n", __func__);
- free(rz->stream);
- free(rz->inbuf);
- free(rz);
- return NULL;
- }
- if ((rz->index = calloc(sizeof(ZBlockIndex), 1)) == NULL) {
- fprintf(stderr, "[%s] failure to allocate index.\n", __func__);
- free(rz->stream);
- free(rz->inbuf);
- free(rz->outbuf);
- free(rz);
- return NULL;
- }
-