}
case LTTNG_LIST_CHANNELS:
{
- int nb_chan;
+ ssize_t payload_size;
struct lttng_channel *channels = NULL;
- nb_chan = cmd_list_channels(cmd_ctx->lsm->domain.type,
+ payload_size = cmd_list_channels(cmd_ctx->lsm->domain.type,
cmd_ctx->session, &channels);
- if (nb_chan < 0) {
+ if (payload_size < 0) {
/* Return value is a negative lttng_error_code. */
- ret = -nb_chan;
+ ret = -payload_size;
goto error;
}
ret = setup_lttng_msg_no_cmd_header(cmd_ctx, channels,
- nb_chan * sizeof(struct lttng_channel));
+ payload_size);
free(channels);
if (ret < 0) {
struct lttcomm_event_command_header cmd_header;
size_t total_size;
+ memset(&cmd_header, 0, sizeof(cmd_header));
/* Extended infos are included at the end of events */
nb_event = cmd_list_events(cmd_ctx->lsm->domain.type,
cmd_ctx->session, cmd_ctx->lsm->u.list.channel_name,