Whamcloud - gitweb
LU-16518 rsync: fix new clang error in lustre_rsync.c 65/52565/3
authorTimothy Day <timday@amazon.com>
Tue, 3 Oct 2023 16:06:18 +0000 (16:06 +0000)
committerOleg Drokin <green@whamcloud.com>
Wed, 8 Nov 2023 22:04:07 +0000 (22:04 +0000)
If we bail out of the function early, changelog_priv
may not be initialized when we check it during the
cleanup code. Initialize changelog_priv to NULL to
avoid this.

Fixes: 4fc99832 ("LU-17000 coverity: Fix Resource Leak(1)")
Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: Ide0430284b18f085e421cdea677ea14e0a4bac14
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52565
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
lustre/utils/lustre_rsync.c

index f1c9a00..07e8eea 100644 (file)
@@ -1544,7 +1544,7 @@ void lr_print_failure(struct lr_info *info, int rc)
 /* Replicate filesystem operations from src_path to target_path */
 int lr_replicate(void)
 {
-       void *changelog_priv;
+       void *changelog_priv = NULL;
        struct lr_info *info;
        struct lr_info *ext = NULL;
        time_t start;