* POSSIBILITY OF SUCH DAMAGE.
*/
+#include <assert.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
ALLOCD_INT(zck, comp);
comp->dc_data = realloc(comp->dc_data, comp->dc_data_size + src_size);
- if(comp->dc_data == NULL) {
- set_fatal_error(zck, "Unable to allocate %lu bytes",
- comp->dc_data_size + src_size);
- return -1;
- }
+ assert(comp->dc_data);
+
memcpy(comp->dc_data + comp->dc_data_size, src, src_size);
*dst = NULL;
*dst_size = 0;
}
*dst = zmalloc(max_size);
- if(dst == NULL) {
- set_fatal_error(zck, "Unable to allocate %lu bytes", max_size);
- return false;
- }
+ assert(*dst);
/* Currently, compression isn't deterministic when using contexts in
* zstd 1.3.5, so this works around it */
comp->data_size = 0;
char *dst = zmalloc(fd_size);
- if(dst == NULL) {
- set_fatal_error(zck, "Unable to allocate %lu bytes", fd_size);
- goto decomp_error_1;
- }
+ assert(dst);
size_t retval;
zck_log(ZCK_LOG_DEBUG, "Decompressing %lu bytes to %lu bytes", src_size,
return true;
decomp_error_2:
free(dst);
-decomp_error_1:
free(src);
return false;
}