Fix: sessiond consumer thread should register as RCU thread
[lttng-tools.git] / src / bin / lttng-sessiond / agent.c
index 29541ac23c57a4979470367f3fe464ef0cf7ef5e..c0b8a218b5acb0ef3cc33d53e2df2a805b01d7fc 100644 (file)
@@ -124,7 +124,7 @@ static void destroy_event_agent_rcu(struct rcu_head *head)
        struct agent_event *event =
                caa_container_of(node, struct agent_event, node);
 
-       free(event);
+       agent_destroy_event(event);
 }
 
 /*
@@ -919,8 +919,7 @@ void agent_destroy_event(struct agent_event *event)
 }
 
 /*
- * Destroy an agent completely. Note that the given pointer is NOT freed
- * thus a reference to static or stack data can be passed to this function.
+ * Destroy an agent completely.
  */
 void agent_destroy(struct agent *agt)
 {
@@ -959,6 +958,7 @@ void agent_destroy(struct agent *agt)
        rcu_read_unlock();
 
        ht_cleanup_push(agt->events);
+       free(agt);
 }
 
 /*
This page took 0.024328 seconds and 4 git commands to generate.