snapshot_output->max_size);
if (nb_packets_per_stream < 0) {
ret_code = LTTNG_ERR_MAX_SIZE_INVALID;
- goto error;
+ goto error_close_trace_chunk;
}
if (session->kernel_session) {
snapshot_kernel_consumer_output, session,
wait, nb_packets_per_stream);
if (ret_code != LTTNG_OK) {
- goto error;
+ goto error_close_trace_chunk;
}
}
snapshot_ust_consumer_output, session,
wait, nb_packets_per_stream);
if (ret_code != LTTNG_OK) {
- goto error;
+ goto error_close_trace_chunk;
}
}
+error_close_trace_chunk:
if (session_set_trace_chunk(session, NULL, &snapshot_trace_chunk)) {
ERR("Failed to release the current trace chunk of session \"%s\"",
session->name);