From db582e11fda4f8d8487e04a230e429d15f27f126 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 3 Oct 2018 11:28:11 -0400 Subject: [PATCH] Fix: uninitialized variable may be used in local rotation check MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ** 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 --- src/bin/lttng-sessiond/rotation-thread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lttng-sessiond/rotation-thread.c b/src/bin/lttng-sessiond/rotation-thread.c index 2dfd97357..3747ebae7 100644 --- a/src/bin/lttng-sessiond/rotation-thread.c +++ b/src/bin/lttng-sessiond/rotation-thread.c @@ -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; -- 2.34.1