From: Mathieu Desnoyers Date: Tue, 18 Jun 2013 18:58:46 +0000 (-0400) Subject: Fix: unnecessarily large memory allocation X-Git-Tag: v2.2.0-rc3~18 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=747f8642070cc390b8f99a6385062ac0cb6716c4;p=lttng-tools.git Fix: unnecessarily large memory allocation 1019911 Wrong sizeof argument In consumer_thread_data_poll: The sizeof operator is invoked on the wrong argument (CWE-569) Signed-off-by: Mathieu Desnoyers --- diff --git a/src/common/consumer.c b/src/common/consumer.c index 45eede109..6990dd967 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -2349,7 +2349,7 @@ void *consumer_thread_data_poll(void *data) /* allocate for all fds + 1 for the consumer_data_pipe */ local_stream = zmalloc((consumer_data.stream_count + 1) * - sizeof(struct lttng_consumer_stream)); + sizeof(struct lttng_consumer_stream *)); if (local_stream == NULL) { PERROR("local_stream malloc"); pthread_mutex_unlock(&consumer_data.lock);