X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconfig%2Fsession-config.cpp;h=9e5f0ff20cbf298b4753c2e0bf2975e7b8d5ea25;hb=64803277bbdbe0a943360d918298a48157d9da55;hp=143f8365e9baf6b59ceed4c87160b10e877c153d;hpb=1c9a0b0e83c7e073c4e576c0bed95de335b0e502;p=lttng-tools.git diff --git a/src/common/config/session-config.cpp b/src/common/config/session-config.cpp index 143f8365e..9e5f0ff20 100644 --- a/src/common/config/session-config.cpp +++ b/src/common/config/session-config.cpp @@ -18,12 +18,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -34,8 +34,8 @@ #include #include -#include "session-config.h" -#include "config-internal.h" +#include "session-config.hpp" +#include "config-internal.hpp" #define CONFIG_USERSPACE_PROBE_LOOKUP_METHOD_NAME_MAX_LEN 7 @@ -287,7 +287,7 @@ struct config_writer *config_writer_create(int fd_output, int indent) struct config_writer *writer; xmlOutputBufferPtr buffer; - writer = (config_writer *) zmalloc(sizeof(struct config_writer)); + writer = zmalloc(); if (!writer) { PERROR("zmalloc config_writer_create"); goto end; @@ -581,7 +581,7 @@ char *get_session_config_xsd_path(void) base_path_len = strlen(base_path); max_path_len = base_path_len + sizeof(DEFAULT_SESSION_CONFIG_XSD_FILENAME) + 1; - xsd_path = (char *) zmalloc(max_path_len); + xsd_path = zmalloc(max_path_len); if (!xsd_path) { goto end; } @@ -1856,7 +1856,7 @@ int process_event_node(xmlNodePtr event_node, struct lttng_handle *handle, continue; } - exclusions = (char **) zmalloc(exclusion_count * sizeof(char *)); + exclusions = calloc(exclusion_count); if (!exclusions) { exclusion_count = 0; ret = -LTTNG_ERR_NOMEM; @@ -3399,9 +3399,8 @@ int process_session_node(xmlNodePtr session_node, const char *session_name, /* Init domains to create the session handles */ for (node = xmlFirstElementChild(domains_node); node; node = xmlNextElementSibling(node)) { - struct lttng_domain *domain; + lttng_domain *domain = zmalloc(); - domain = (lttng_domain *) zmalloc(sizeof(*domain)); if (!domain) { ret = -LTTNG_ERR_NOMEM; goto error;