get_pw_buf_size = (size_t) raw_get_pw_buf_size;
- buf = (char *) zmalloc(get_pw_buf_size);
+ buf = calloc<char>(get_pw_buf_size);
if (buf == NULL) {
PERROR("Failed to allocate buffer to get password file entries");
goto error;
ret = 0;
goto end;
}
- worker = (run_as_worker_data *) zmalloc(sizeof(*worker));
+ worker = zmalloc<run_as_worker_data>();
if (!worker) {
ret = -ENOMEM;
goto end;
}
*num_offset = run_as_ret.u.extract_sdt_probe_offsets.num_offset;
- *offsets = (uint64_t *) zmalloc(*num_offset * sizeof(uint64_t));
+ *offsets = calloc<uint64_t>(*num_offset);
if (!*offsets) {
ret = -ENOMEM;
goto error;
view_bytecode = (const struct lttng_bytecode *) run_as_ret.u.generate_filter_bytecode.bytecode;
- local_bytecode = (lttng_bytecode *) zmalloc(sizeof(*local_bytecode) + view_bytecode->len);
+ local_bytecode = calloc<lttng_bytecode>(view_bytecode->len);
if (!local_bytecode) {
ret = -ENOMEM;
goto error;