}
lttng_poll_clean(&handle->communication.events);
lttng_dynamic_buffer_reset(&handle->communication.buffer);
- lttng_trace_archive_location_destroy(handle->location);
+ lttng_trace_archive_location_put(handle->location);
free(handle);
}
ret = -1;
break;
} else {
+ /* Ownership is transferred to the destruction handle. */
handle->location = location;
handle->communication.state = COMMUNICATION_STATE_END;
}
int sessiond_socket = -1;
struct lttng_destruction_handle *handle = NULL;
- if (!session_name || !_handle) {
+ if (!session_name) {
ret_code = LTTNG_ERR_INVALID;
goto error;
}