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)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 25 Jun 2020 17:09:03 +0000 (13:09 -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 4aee51813aea2b820f5153255cbfc04254ece245..688492e439d0811cc17308667055a5bcc7c3b9d5 100644 (file)
@@ -3146,7 +3146,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;
        struct stream_subbuffer subbuffer = {};
 
        if (!locked_by_caller) {
This page took 0.028368 seconds and 5 git commands to generate.