goto error;
}
- reply = (lttcomm_agent_list_reply *) zmalloc(data_size);
+ reply = zmalloc<lttcomm_agent_list_reply>(data_size);
if (!reply) {
ret = LTTNG_ERR_NOMEM;
goto error;
}
nb_event = be32toh(reply->nb_event);
- tmp_events = (lttng_event *) zmalloc(sizeof(*tmp_events) * nb_event);
+ tmp_events = calloc<lttng_event>(nb_event);
if (!tmp_events) {
ret = LTTNG_ERR_NOMEM;
goto error;
goto error_io;
}
- bytes_to_send = (char *) zmalloc(data_size);
+ bytes_to_send = calloc<char>(data_size);
if (!bytes_to_send) {
ret = LTTNG_ERR_NOMEM;
goto error;
}
LTTNG_ASSERT(ctx->ctx == LTTNG_EVENT_CONTEXT_APP_CONTEXT);
- agent_ctx = (agent_app_ctx *) zmalloc(sizeof(*ctx));
+ agent_ctx = zmalloc<agent_app_ctx>();
if (!agent_ctx) {
goto end;
}
DBG2("Agent listing events for domain %d", domain);
nbmem = UST_APP_EVENT_LIST_SIZE;
- tmp_events = (lttng_event *) zmalloc(nbmem * sizeof(*tmp_events));
+ tmp_events = calloc<lttng_event>(nbmem);
if (!tmp_events) {
PERROR("zmalloc agent list events");
ret = -ENOMEM;
LTTNG_ASSERT(sock);
- app = (agent_app *) zmalloc(sizeof(*app));
+ app = zmalloc<agent_app>();
if (!app) {
PERROR("Failed to allocate agent application instance");
goto error;
int ret;
struct agent *agt;
- agt = (agent *) zmalloc(sizeof(struct agent));
+ agt = zmalloc<agent>();
if (!agt) {
goto error;
}
goto error;
}
- event = (agent_event *) zmalloc(sizeof(*event));
+ event = zmalloc<agent_event>();
if (!event) {
goto error;
}