Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
}
/* Alloc group list of the right size */
- grp_list = malloc(grp_list_size * sizeof(gid_t));
+ grp_list = zmalloc(grp_list_size * sizeof(gid_t));
if (!grp_list) {
perror("malloc");
goto end;
goto end;
}
- data = (void*) malloc(size);
+ data = zmalloc(size);
+ if (!data) {
+ ret = -ENOMEM;
+ goto end;
+ }
/* Get payload data */
ret = recv_data_sessiond(data, size);
goto end;
}
- handle = malloc(sizeof(struct lttng_handle));
+ handle = zmalloc(sizeof(struct lttng_handle));
if (handle == NULL) {
PERROR("malloc handle");
goto end;