Fix: consumer: incorrect size zmalloc
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 4 Jul 2013 21:53:50 +0000 (17:53 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 5 Jul 2013 18:59:16 +0000 (14:59 -0400)
Also, check return value.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/common/consumer.c

index 910f386d932f5a71924bd637b4a5a467abcd6e2f..c7bc1e7a05b75010135d18cda82bf7fa322b1150 100644 (file)
@@ -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;
This page took 0.027055 seconds and 4 git commands to generate.