Fix: Memory leak of agent
[lttng-tools.git] / src / bin / lttng-sessiond / agent.c
index 3e70701b2badc0c8aab14d85713e0d6e9c972376..c0b8a218b5acb0ef3cc33d53e2df2a805b01d7fc 100644 (file)
@@ -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.027217 seconds and 4 git commands to generate.