From 4df6c8cbd1b0916288b64abdbdb1e83c3d5eae4f Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 4 Jul 2013 17:53:50 -0400 Subject: [PATCH] Fix: consumer: incorrect size zmalloc Also, check return value. Signed-off-by: Mathieu Desnoyers --- src/common/consumer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/consumer.c b/src/common/consumer.c index 910f386d9..c7bc1e7a0 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -2291,7 +2291,11 @@ void *consumer_thread_data_poll(void *data) goto end; } - local_stream = zmalloc(sizeof(struct lttng_consumer_stream)); + local_stream = zmalloc(sizeof(struct lttng_consumer_stream *)); + if (local_stream == NULL) { + PERROR("local_stream malloc"); + goto end; + } while (1) { high_prio = 0; -- 2.34.1