}
end:
cds_list_del(&cmd->cmd_list_node);
- lttng_waiter_wake_up(&cmd->reply_waiter);
+ if (cmd->is_async) {
+ free(cmd);
+ cmd = NULL;
+ } else {
+ lttng_waiter_wake_up(&cmd->reply_waiter);
+ }
pthread_mutex_unlock(&handle->cmd_queue.lock);
return ret;
error_unlock: