The list command never check if a domain's agent has been found
and lists the events of every agent.
This has two direct effects:
1) Memory leak of all agents' event descriptions, except the last
2) The session daemon lists the wrong agent's events
This fix check the agent's domain and breaks out of the loop once
one is found.
Fixes #906
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
rcu_read_lock();
cds_lfht_for_each_entry(session->ust_session->agents->ht,
&iter.iter, agt, node.node) {
- nb_event = list_lttng_agent_events(agt, events);
+ if (agt->domain == domain) {
+ nb_event = list_lttng_agent_events(
+ agt, events);
+ break;
+ }
}
rcu_read_unlock();
}