X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fust-consumer%2Fust-consumer.cpp;h=766c9d30c7ff27f1a7ff796043f24aaf2a3ad90a;hb=64803277bbdbe0a943360d918298a48157d9da55;hp=5e9a442eb5058a98584c432d3bcebb351c25f683;hpb=60f1b42d6280b6bd386abb726dca4fd3b31d8491;p=lttng-tools.git diff --git a/src/common/ust-consumer/ust-consumer.cpp b/src/common/ust-consumer/ust-consumer.cpp index 5e9a442eb..766c9d30c 100644 --- a/src/common/ust-consumer/ust-consumer.cpp +++ b/src/common/ust-consumer/ust-consumer.cpp @@ -407,7 +407,7 @@ static int create_ust_channel(struct lttng_consumer_channel *channel, nr_stream_fds = 1; else nr_stream_fds = lttng_ust_ctl_get_nr_stream_per_channel(); - stream_fds = (int *) zmalloc(nr_stream_fds * sizeof(*stream_fds)); + stream_fds = calloc(nr_stream_fds); if (!stream_fds) { ret = -1; goto error_alloc; @@ -1286,7 +1286,7 @@ int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset, DBG("UST consumer push metadata key %" PRIu64 " of len %" PRIu64, key, len); - metadata_str = (char *) zmalloc(len * sizeof(char)); + metadata_str = calloc(len); if (!metadata_str) { PERROR("zmalloc metadata string"); ret_code = LTTCOMM_CONSUMERD_ENOMEM;