From 747f8642070cc390b8f99a6385062ac0cb6716c4 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 18 Jun 2013 14:58:46 -0400 Subject: [PATCH] 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 --- src/common/consumer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.34.1