X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Flttng-ctl.c;h=20dca8132186e46531589d9294b31a44dc52e9b3;hp=bbff088e098107ebd64b171116f767a1f7126079;hb=4e328cceb6ff5fd6240c866b52b29234946c5c66;hpb=28ab59d0baef178a8629ec9fb517ba75efb46ea8 diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index bbff088e0..20dca8132 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -1078,7 +1078,11 @@ int lttng_enable_event_with_exclusions(struct lttng_handle *handle, unsigned int free_filter_expression = 0; struct filter_parser_ctx *ctx = NULL; - memset(&send_buffer, 0, sizeof(send_buffer)); + /* + * We have either a filter or some exclusions, so we need to set up + * a variable-length memory block from where to send the data. + */ + lttng_dynamic_buffer_init(&send_buffer); /* * Cast as non-const since we may replace the filter expression @@ -1128,12 +1132,6 @@ int lttng_enable_event_with_exclusions(struct lttng_handle *handle, lsm.u.enable.exclusion_count = exclusion_count; lsm.u.enable.bytecode_len = 0; - /* - * We have either a filter or some exclusions, so we need to set up - * a variable-length memory block from where to send the data. - */ - lttng_dynamic_buffer_init(&send_buffer); - /* Parse filter expression. */ if (filter_expression != NULL || handle->domain.type == LTTNG_DOMAIN_JUL || handle->domain.type == LTTNG_DOMAIN_LOG4J @@ -2079,7 +2077,6 @@ int lttng_list_sessions(struct lttng_session **out_sessions) lsm.cmd_type = LTTNG_LIST_SESSIONS; ret = lttng_ctl_ask_sessiond(&lsm, (void**) &sessions); if (ret <= 0) { - ret = ret == 0 ? -LTTNG_ERR_FATAL : ret; goto end; } if (!sessions) {