Blame SOURCES/cyrus-imapd-close_backup_fd_on_error.patch

388f6b
From 725e1efbd923c6d15ba639e17bfd0baabc619daa Mon Sep 17 00:00:00 2001
388f6b
From: Pavel Zhukov <pzhukov@redhat.com>
388f6b
Date: Mon, 1 Oct 2018 15:55:35 +0200
388f6b
Subject: [PATCH] Close file descriptior in case of error
388f6b
388f6b
Make static code analizers happy.
388f6b
If stat() failed for some reason it may lead backup fd unclosed.
388f6b
---
388f6b
 backup/lcb.c | 1 +
388f6b
 1 file changed, 1 insertion(+)
388f6b
388f6b
diff --git a/backup/lcb.c b/backup/lcb.c
388f6b
index 8c4a0e31a..9a04b08f2 100644
388f6b
--- a/backup/lcb.c
388f6b
+++ b/backup/lcb.c
388f6b
@@ -182,6 +182,7 @@ HIDDEN int backup_real_open(struct backup **backupp,
388f6b
         if (r) {
388f6b
             syslog(LOG_ERR, "IOERROR: (f)stat %s: %m", backup->data_fname);
388f6b
             r = IMAP_IOERROR;
388f6b
+            close(fd);
388f6b
             goto error;
388f6b
         }
388f6b