Fix: uninitialized variable may be used in local rotation check
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 3 Oct 2018 15:28:11 +0000 (11:28 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 3 Oct 2018 15:28:16 +0000 (11:28 -0400)
** CID 1395985:  Uninitialized variables  (UNINIT)

'ret' may be left uninitialized if no consumer daemons are
iterated-upon to perform a local rotation pending check.

In practice this wont' happen as that would mean that the
ltt_session has no user space nor kernel session action, thus
no rotation would be launched.

Reported-by: Coverity Scan
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/rotation-thread.c

index 2dfd9735741b7f12111a5af45e6dee346bf631dd..3747ebae7fe337713c1758ad08fe2b8c1c775f10 100644 (file)
@@ -394,7 +394,7 @@ int check_session_rotation_pending_local_on_consumer(
 static
 int check_session_rotation_pending_local(struct ltt_session *session)
 {
-       int ret;
+       int ret = 0;
        struct consumer_socket *socket;
        struct cds_lfht_iter iter;
        bool rotation_completed = true;
This page took 0.038324 seconds and 5 git commands to generate.