X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fchannel.cpp;h=5bef795589d75c4349cdf05fe31b65a77369698f;hb=64803277bbdbe0a943360d918298a48157d9da55;hp=be3b62343ec447bdb45b619a79452e55e0796772;hpb=60f1b42d6280b6bd386abb726dca4fd3b31d8491;p=lttng-tools.git diff --git a/src/common/channel.cpp b/src/common/channel.cpp index be3b62343..5bef79558 100644 --- a/src/common/channel.cpp +++ b/src/common/channel.cpp @@ -37,7 +37,7 @@ struct lttng_channel *lttng_channel_copy(const struct lttng_channel *src) struct lttng_channel_extended *extended = nullptr; struct lttng_channel *channel = nullptr, *ret = nullptr; - channel = (struct lttng_channel *) zmalloc(sizeof(*channel)); + channel = zmalloc(); if (!channel) { goto end; } @@ -45,8 +45,7 @@ struct lttng_channel *lttng_channel_copy(const struct lttng_channel *src) *channel = *src; if (src->attr.extended.ptr) { - extended = (struct lttng_channel_extended *) zmalloc( - sizeof(*extended)); + extended = zmalloc(); if (!extended) { goto end; } @@ -71,15 +70,13 @@ struct lttng_channel *lttng_channel_create_internal(void) struct lttng_channel *local_channel = nullptr, *ret = nullptr; struct lttng_channel_extended *extended = nullptr; - local_channel = (struct lttng_channel *) zmalloc( - sizeof(struct lttng_channel)); + local_channel = zmalloc(); if (!local_channel) { goto end; } /* Extended struct */ - extended = (struct lttng_channel_extended *) zmalloc( - sizeof(*extended)); + extended = zmalloc(); if (!extended) { goto end; }