/* Alloc group list of the right size */
grp_list = malloc(grp_list_size * sizeof(gid_t));
+ if (!grp_list) {
+ ret = -1;
+ goto end;
+ }
grp_id = getgroups(grp_list_size, grp_list);
if (grp_id < -1) {
perror("getgroups");
copy_lttng_domain(&lsm.domain, &handle->domain);
- if (ev) {
+ if (ev || ev->name[0] != '\0') {
lsm.cmd_type = LTTNG_ENABLE_EVENT;
memcpy(&lsm.u.enable.event, ev, sizeof(lsm.u.enable.event));
} else {