Fix: lttng-snapshot: use after free of max size argument
[lttng-tools.git] / src / bin / lttng / commands / track-untrack.cpp
index 7547f8b5ddfd6f84a6de4cea3d8bb094d72e737e..e311304f4aa40bf10a491dab12d2b6f41402ab56 100644 (file)
 
 #include <urcu/list.h>
 
-#include <common/dynamic-array.h>
-#include <common/mi-lttng.h>
-#include <common/optional.h>
-#include <common/dynamic-buffer.h>
-#include <common/tracker.h>
+#include <common/dynamic-array.hpp>
+#include <common/mi-lttng.hpp>
+#include <common/optional.hpp>
+#include <common/dynamic-buffer.hpp>
+#include <common/tracker.hpp>
 
 #include <lttng/lttng.h>
 
-#include "../command.h"
+#include "../command.hpp"
 
+namespace {
 struct process_attr_command_args {
        enum lttng_process_attr process_attr;
        /* Present in the user's command. */
@@ -37,6 +38,7 @@ struct process_attr_command_args {
        bool all;
        struct lttng_dynamic_pointer_array string_args;
 };
+} /* namespace */
 
 enum cmd_type {
        CMD_TRACK,
@@ -87,7 +89,7 @@ static void process_attr_command_init(struct process_attr_command_args *cmd,
 {
        cmd->process_attr = process_attr;
        cmd->all = false;
-       lttng_dynamic_pointer_array_init(&cmd->string_args, NULL);
+       lttng_dynamic_pointer_array_init(&cmd->string_args, free);
 }
 
 static void process_attr_command_fini(struct process_attr_command_args *cmd)
@@ -566,7 +568,7 @@ end:
 static int cmd_track_untrack(enum cmd_type cmd_type,
                int argc,
                const char **argv,
-               const char *help_msg)
+               const char *help_msg __attribute__((unused)))
 {
        int opt, ret = 0;
        bool sub_command_failed = false;
This page took 0.02345 seconds and 4 git commands to generate.