Fix: sessiond: ODR violation results in memory corruption
[lttng-tools.git] / src / common / actions / list.cpp
index c80832570d2dab694a4e77c61a33adffc84cdd26..1d962152b0e825e9b422542d7d37126c9de5e18b 100644 (file)
@@ -18,6 +18,7 @@
 #define IS_LIST_ACTION(action) \
        (lttng_action_get_type(action) == LTTNG_ACTION_TYPE_LIST)
 
+namespace {
 struct lttng_action_list {
        struct lttng_action parent;
 
@@ -33,6 +34,7 @@ struct lttng_action_list_comm {
         */
        char data[];
 } LTTNG_PACKED;
+} /* namespace */
 
 static void destroy_lttng_action_list_element(void *ptr)
 {
@@ -362,7 +364,7 @@ struct lttng_action *lttng_action_list_create(void)
        struct lttng_action_list *action_list;
        struct lttng_action *action;
 
-       action_list = (lttng_action_list *) zmalloc(sizeof(struct lttng_action_list));
+       action_list = zmalloc<lttng_action_list>();
        if (!action_list) {
                action = NULL;
                goto end;
This page took 0.026219 seconds and 4 git commands to generate.