Fix segmentation fault by adding trace into trace collection only after
check for time correlation has succeeded.
Reported-by: Etienne Bergeron <etienneb@google.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
return -EINVAL;
trace = container_of(td, struct ctf_trace, parent);
- g_ptr_array_add(tc->array, td);
- trace->collection = tc;
if (tc->array->len > 1) {
struct clock_match clock_match = {
}
}
+ g_ptr_array_add(tc->array, td);
+ trace->collection = tc;
+
{
struct clock_match clock_match = {
.clocks = tc->clocks,