struct agent_event *event =
caa_container_of(node, struct agent_event, node);
- free(event);
+ agent_destroy_event(event);
}
/*
DBG("Agent sending registration done to app socket %d", app->sock->fd);
- return send_header(app->sock, 0, AGENT_CMD_REG_DONE, 0);
+ return send_header(app->sock, 0, AGENT_CMD_REG_DONE, 1);
}
/*
int agent_disable_event(struct agent_event *event,
enum lttng_domain_type domain)
{
- int ret;
+ int ret = LTTNG_OK;
struct agent_app *app;
struct lttng_ht_iter iter;
assert(event);
+ if (!event->enabled) {
+ goto end;
+ }
rcu_read_lock();
}
event->enabled = 0;
- ret = LTTNG_OK;
error:
rcu_read_unlock();
+end:
return ret;
}
assert(event);
free(event->filter);
+ free(event->filter_expression);
free(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)
{
rcu_read_unlock();
ht_cleanup_push(agt->events);
+ free(agt);
}
/*