From 6aede1254803dfbde728a6b34c627ccc924a8f79 Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Tue, 3 Oct 2023 16:06:18 +0000 Subject: [PATCH] LU-16518 rsync: fix new clang error in lustre_rsync.c 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 Change-Id: Ide0430284b18f085e421cdea677ea14e0a4bac14 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52565 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger Reviewed-by: Arshad Hussain --- lustre/utils/lustre_rsync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lustre/utils/lustre_rsync.c b/lustre/utils/lustre_rsync.c index f1c9a00..07e8eea 100644 --- a/lustre/utils/lustre_rsync.c +++ b/lustre/utils/lustre_rsync.c @@ -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; -- 1.8.3.1