Fix: consumerd: uninitialized written_bytes on no-data sleep
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 17 Jun 2020 23:13:50 +0000 (19:13 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 17 Jun 2020 23:17:30 +0000 (19:17 -0400)
e66d26f51 introduces a jump to a label which causes `written_bytes`
(the return value) to not be initialized.

written_bytes may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I72c5c07298093f27fa72b72cb157ce4eedb81adb

src/common/consumer/consumer.c

index da5d7ccfb68ffcf7f8ecbde438baccce4538ad65..11c43046c8d2370cad2ab0cf2bc9701cce6731a1 100644 (file)
@@ -3314,7 +3314,7 @@ ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream,
                struct lttng_consumer_local_data *ctx,
                bool locked_by_caller)
 {
-       ssize_t ret, written_bytes;
+       ssize_t ret, written_bytes = 0;
        int rotation_ret;
        struct stream_subbuffer subbuffer = {};
 
This page took 0.027214 seconds and 4 git commands to generate.