Fix: statements with side-effects in assert statements
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index 7715e145260d7886bfac00683fa28b1d34362f7a..3b776c57634fcfa5f05688a2c7b2c8233fb505b7 100644 (file)
@@ -3241,6 +3241,7 @@ void cmd_destroy_session_reply(const struct ltt_session *session,
        payload_size_before_location = payload.size;
        comm_ret = lttng_trace_archive_location_serialize(location,
                        &payload);
+       lttng_trace_archive_location_put(location);
        if (comm_ret < 0) {
                ERR("Failed to serialize the location of the trace archive produced during the destruction of session \"%s\"",
                                session->name);
@@ -4631,11 +4632,11 @@ end:
        return ret_code;
 }
 
-int cmd_list_triggers(struct command_ctx *cmd_ctx,
+enum lttng_error_code cmd_list_triggers(struct command_ctx *cmd_ctx,
                struct notification_thread_handle *notification_thread,
                struct lttng_triggers **return_triggers)
 {
-       int ret = 0;
+       int ret;
        enum lttng_error_code ret_code;
        struct lttng_triggers *triggers = NULL;
 
@@ -4643,16 +4644,21 @@ int cmd_list_triggers(struct command_ctx *cmd_ctx,
        ret_code = notification_thread_command_list_triggers(
                        notification_thread, cmd_ctx->creds.uid, &triggers);
        if (ret_code != LTTNG_OK) {
-               ret = ret_code;
+               goto end;
+       }
+
+       ret = lttng_triggers_remove_hidden_triggers(triggers);
+       if (ret) {
+               ret_code = LTTNG_ERR_UNK;
                goto end;
        }
 
        *return_triggers = triggers;
        triggers = NULL;
-       ret = LTTNG_OK;
+       ret_code = LTTNG_OK;
 end:
        lttng_triggers_destroy(triggers);
-       return ret;
+       return ret_code;
 }
 
 enum lttng_error_code cmd_execute_error_query(const struct lttng_credentials *cmd_creds,
This page took 0.024624 seconds and 4 git commands to generate.