Fix: sessiond: ODR violation results in memory corruption
[lttng-tools.git] / src / common / actions / path.cpp
index 816f2cd219cd49d865270136e68cacf2617a8c7d..4728485177a209a5c5aa7ddfc95033c04c3cd597 100644 (file)
@@ -5,12 +5,14 @@
  *
  */
 
-#include <lttng/action/path-internal.h>
+#include <lttng/action/path-internal.hpp>
 
+namespace {
 struct lttng_action_path_comm {
        uint32_t index_count;
        uint64_t indexes[];
 } LTTNG_PACKED;
+} /* namespace */
 
 struct lttng_action_path *lttng_action_path_create(
                const uint64_t *indexes, size_t index_count)
@@ -23,7 +25,7 @@ struct lttng_action_path *lttng_action_path_create(
                goto error;
        }
 
-       path = (lttng_action_path *) zmalloc(sizeof(*path));
+       path = zmalloc<lttng_action_path>();
        if (!path) {
                goto error;
        }
This page took 0.024067 seconds and 4 git commands to generate.