From e81ce85867575428f80124edd51be8f91282c2df Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 16 Mar 2020 10:28:18 +0100 Subject: [PATCH] rsync(): Fix possible memory leak, found by Coverity Scan Signed-off-by: Joachim Nilsson --- src/rsync.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rsync.c b/src/rsync.c index af802a2..3f15f2d 100644 --- a/src/rsync.c +++ b/src/rsync.c @@ -110,8 +110,10 @@ int rsync(char *src, char *dst, int opt, int (*filter)(const char *file)) struct stat sb; strcat(source, "/"); - if (stat(source, &sb)) - return 1; + if (stat(source, &sb)) { + result++; + continue; + } if (mdir(dst2, sizeof(dst2), dst, files[i], &sb)) { result++;