Fix: sessiond: ODR violation results in memory corruption
[lttng-tools.git] / src / common / ini-config / ini-config.cpp
index 797de0164d35303716c880a4d306cee10a5b5b8b..da204d988c0aa9557979f550080b72384d0d1c28 100644 (file)
@@ -5,13 +5,13 @@
  *
  */
 
-#include "ini-config.h"
+#include "ini-config.hpp"
 
-#include <common/defaults.h>
-#include <common/error.h>
-#include <common/ini-config/ini.h>
-#include <common/macros.h>
-#include <common/utils.h>
+#include <common/defaults.hpp>
+#include <common/error.hpp>
+#include <common/ini-config/ini.hpp>
+#include <common/macros.hpp>
+#include <common/utils.hpp>
 #include <ctype.h>
 
 LTTNG_EXPORT const char *config_str_yes = "yes";
@@ -21,11 +21,13 @@ LTTNG_EXPORT const char *config_str_no = "no";
 LTTNG_EXPORT const char *config_str_false = "false";
 LTTNG_EXPORT const char *config_str_off = "off";
 
+namespace {
 struct handler_filter_args {
        const char* section;
        config_entry_handler_cb handler;
        void *user_data;
 };
+} /* namespace */
 
 static int config_entry_handler_filter(struct handler_filter_args *args,
                const char *section, const char *name, const char *value)
@@ -144,7 +146,7 @@ int config_parse_value(const char *value)
                goto end;
        }
 
-       lower_str = (char *) zmalloc(len + 1);
+       lower_str = zmalloc<char>(len + 1);
        if (!lower_str) {
                PERROR("zmalloc");
                ret = -errno;
This page took 0.024746 seconds and 4 git commands to generate.