sessiond: clean-up: silence warning that agent event is leaked
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 25 Sep 2019 21:06:23 +0000 (17:06 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 25 Sep 2019 21:06:23 +0000 (17:06 -0400)
Both Coverity and scan-build got confused by this
function. Essentially, they warn that aevent can be leaked if
it is created in an already enabled state. We know that this can't
happen as the events are created in a disabled state.

Add an assert that created events are not enabled to help the static
analyzers. This could also catch the leak should this change in the
future.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/event.c

index a8b7646da6f9401c617761e3f6ca349e274ed065..e687caf8622729a85a316ac367cf5172fce386d0 100644 (file)
@@ -511,6 +511,7 @@ int event_agent_enable(struct ltt_ust_session *usess,
                filter = NULL;
                filter_expression = NULL;
                created = 1;
+               assert(!aevent->enabled);
        }
 
        if (created && aevent->filter) {
This page took 0.027475 seconds and 4 git commands to generate.