X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fevent-rule%2Fuser-tracepoint.cpp;h=48040fc59292384310ae1ac4fb19e0332266b08b;hb=64803277bbdbe0a943360d918298a48157d9da55;hp=cc76d229dba4872eb92409e468fd7e054d1e890f;hpb=2d6df81a3d233d7aaf34b874087555e72b105877;p=lttng-tools.git diff --git a/src/common/event-rule/user-tracepoint.cpp b/src/common/event-rule/user-tracepoint.cpp index cc76d229d..48040fc59 100644 --- a/src/common/event-rule/user-tracepoint.cpp +++ b/src/common/event-rule/user-tracepoint.cpp @@ -5,19 +5,19 @@ * */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -362,8 +362,7 @@ lttng_event_rule_user_tracepoint_generate_exclusions( goto end; } - exclusions = (lttng_event_exclusion *) zmalloc(sizeof(struct lttng_event_exclusion) + - (LTTNG_SYMBOL_NAME_LEN * nb_exclusions)); + exclusions = zmalloc(sizeof(struct lttng_event_exclusion) + (LTTNG_SYMBOL_NAME_LEN * nb_exclusions)); if (!exclusions) { PERROR("Failed to allocate exclusions buffer"); ret_status = LTTNG_EVENT_RULE_GENERATE_EXCLUSIONS_STATUS_OUT_OF_MEMORY; @@ -380,8 +379,10 @@ lttng_event_rule_user_tracepoint_generate_exclusions( rule, i, &exclusion_str); LTTNG_ASSERT(event_rule_status == LTTNG_EVENT_RULE_STATUS_OK); - copy_ret = lttng_strncpy(exclusions->names[i], exclusion_str, - sizeof(exclusions->names[i])); + copy_ret = lttng_strncpy( + LTTNG_EVENT_EXCLUSION_NAME_AT(exclusions, i), + exclusion_str, + sizeof(LTTNG_EVENT_EXCLUSION_NAME_AT(exclusions, i))); if (copy_ret) { free(exclusions); exclusions = NULL; @@ -558,7 +559,7 @@ struct lttng_event_rule *lttng_event_rule_user_tracepoint_create(void) struct lttng_event_rule_user_tracepoint *tp_rule; enum lttng_event_rule_status status; - tp_rule = (lttng_event_rule_user_tracepoint *) zmalloc(sizeof(struct lttng_event_rule_user_tracepoint)); + tp_rule = zmalloc(); if (!tp_rule) { goto end; }