Clean-up: lttng: add-trigger: silence coverity warning
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 21 Apr 2021 19:31:38 +0000 (15:31 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 21 Apr 2021 21:07:07 +0000 (17:07 -0400)
CID 1452634 (#1 of 1): Resource leak (RESOURCE_LEAK)
23. leaked_storage: Variable error going out of scope leaks the storage
it points to.

The code path shown by Coverity does not appear reachable, but this
fixes the warning nonetheless.

Reported-by: Coverity Scan
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I9682616b123de108c5717cee2c17349212f224d5

src/bin/lttng/commands/add_trigger.c

index d460c0ffbda494a31aedd1b1832f498587254c00..10a7944df8e82b4f2f4151917c1ae6c8ed5ca16c 100644 (file)
@@ -1499,8 +1499,8 @@ struct lttng_action *handle_action_notify(int *argc, const char ***argv)
 error:
        lttng_action_destroy(action);
        action = NULL;
-       free(error);
 end:
+       free(error);
        lttng_rate_policy_destroy(policy);
        argpar_state_destroy(state);
        argpar_item_destroy(item);
This page took 0.027811 seconds and 4 git commands to generate.