From 276b26d1bad8b6ede22c70f786f52e467e658bf6 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 9 Nov 2011 11:09:39 -0500 Subject: [PATCH] Fix ust consumer channel memory non-zeroed allocation The cpu count was expecting memory to be zeroed on allocation. Caused stream open errors and zero-sized metadata files (and unability to open channel files). Signed-off-by: Mathieu Desnoyers --- liblttng-consumer/lttng-consumer.c | 2 +- liblttng-ustconsumer/lttng-ustconsumer.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/liblttng-consumer/lttng-consumer.c b/liblttng-consumer/lttng-consumer.c index 54338e800..c7c7b7a7e 100644 --- a/liblttng-consumer/lttng-consumer.c +++ b/liblttng-consumer/lttng-consumer.c @@ -305,7 +305,7 @@ struct lttng_consumer_channel *consumer_allocate_channel( struct lttng_consumer_channel *channel; int ret; - channel = malloc(sizeof(*channel)); + channel = zmalloc(sizeof(*channel)); if (channel == NULL) { perror("malloc struct lttng_consumer_channel"); goto end; diff --git a/liblttng-ustconsumer/lttng-ustconsumer.c b/liblttng-ustconsumer/lttng-ustconsumer.c index 806ebd3c0..ed4a27c9d 100644 --- a/liblttng-ustconsumer/lttng-ustconsumer.c +++ b/liblttng-ustconsumer/lttng-ustconsumer.c @@ -175,7 +175,6 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, msg.u.channel.mmap_len, msg.u.channel.max_sb_size); if (new_channel == NULL) { - fprintf(stderr, "AAAAA\n"); lttng_consumer_send_error(ctx, CONSUMERD_OUTFD_ERROR); goto end_nosignal; } @@ -218,7 +217,6 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, msg.u.stream.output, msg.u.stream.path_name); if (new_stream == NULL) { - fprintf(stderr, "BBBBBB\n"); lttng_consumer_send_error(ctx, CONSUMERD_OUTFD_ERROR); goto end; } -- 2.34.1