X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fagent.c;h=c0b8a218b5acb0ef3cc33d53e2df2a805b01d7fc;hb=b318c0ee9896652084d437b6c1584d7f2e49c911;hp=afc3712a7127007b8d06b19bcd815893fcc33e68;hpb=144361687aad6c68ed40821846f13fcc89c04549;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/agent.c b/src/bin/lttng-sessiond/agent.c index afc3712a7..c0b8a218b 100644 --- a/src/bin/lttng-sessiond/agent.c +++ b/src/bin/lttng-sessiond/agent.c @@ -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); } /* @@ -443,7 +443,7 @@ int agent_send_registration_done(struct agent_app *app) 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); } /* @@ -493,11 +493,14 @@ error: 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(); @@ -515,10 +518,10 @@ int agent_disable_event(struct agent_event *event, } event->enabled = 0; - ret = LTTNG_OK; error: rcu_read_unlock(); +end: return ret; } @@ -911,12 +914,12 @@ void agent_destroy_event(struct agent_event *event) 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) { @@ -955,6 +958,7 @@ void agent_destroy(struct agent *agt) rcu_read_unlock(); ht_cleanup_push(agt->events); + free(agt); } /*