.gitignore: Add hidden trigger test
[lttng-tools.git] / src / bin / lttng / commands / list_triggers.c
index 59db1c5d4b8b499fbd81a5fe10c9ccf9c374da7b..0ef94f83677d93a673ba7b343af54c3418afff9d 100644 (file)
@@ -1191,9 +1191,10 @@ static int print_sorted_triggers(const struct lttng_triggers *triggers)
                        sizeof(struct lttng_trigger *),
                        compare_triggers_by_name);
 
-       for (i = 0; i < num_triggers; i++) {
-               const struct lttng_trigger *trigger_to_print =
-                               (const struct lttng_trigger *)
+       for (i = 0; i < lttng_dynamic_pointer_array_get_count(&sorted_triggers);
+                       i++) {
+               const struct lttng_trigger *trigger_to_print = (const struct lttng_trigger
+                                               *)
                                lttng_dynamic_pointer_array_get_pointer(
                                                &sorted_triggers, i);
 
@@ -1240,6 +1241,7 @@ static enum lttng_error_code mi_error_query_trigger_callback(
                                lttng_strerror(-ret_code));
        }
 
+       lttng_error_query_destroy(query);
        return ret_code;
 }
 
@@ -1273,6 +1275,8 @@ static enum lttng_error_code mi_error_query_action_callback(
                                trigger_name, (int) trigger_uid,
                                lttng_strerror(-ret_code));
        }
+
+       lttng_error_query_destroy(query);
        return ret_code;
 }
 
@@ -1306,8 +1310,10 @@ static enum lttng_error_code mi_error_query_condition_callback(
                                lttng_strerror(-ret_code));
        }
 
+       lttng_error_query_destroy(query);
        return ret_code;
 }
+
 int cmd_list_triggers(int argc, const char **argv)
 {
        int ret;
This page took 0.023912 seconds and 4 git commands to generate.