From: Jérémie Galarneau Date: Wed, 3 Oct 2018 15:28:11 +0000 (-0400) Subject: Fix: uninitialized variable may be used in local rotation check X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=db582e11fda4f8d8487e04a230e429d15f27f126 Fix: uninitialized variable may be used in local rotation check ** 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 --- 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;