Blame SOURCES/cyrus-imapd-close_backup_on_failure.patch

388f6b
From 5d00f649b4d2a599905d1b9290c91a769909741d Mon Sep 17 00:00:00 2001
388f6b
From: Pavel Zhukov <pzhukov@redhat.com>
388f6b
Date: Mon, 24 Sep 2018 17:24:48 +0200
388f6b
Subject: [PATCH] Close backup on failure.
388f6b
388f6b
Static analizers report this as memory leak issue.
388f6b
---
388f6b
 backup/ctl_backups.c | 3 +++
388f6b
 1 file changed, 3 insertions(+)
388f6b
388f6b
diff --git a/backup/ctl_backups.c b/backup/ctl_backups.c
388f6b
index 3d817e743..e532eedb7 100644
388f6b
--- a/backup/ctl_backups.c
388f6b
+++ b/backup/ctl_backups.c
388f6b
@@ -955,6 +955,7 @@ static int lock_run_pipe(const char *userid, const char *fname,
388f6b
 
388f6b
     if (r) {
388f6b
         printf("NO failed (%s)\n", error_message(r));
388f6b
+        r = backup_close(&backup);
388f6b
         return EC_SOFTWARE; // FIXME would something else be more appropriate?
388f6b
     }
388f6b
 
388f6b
@@ -993,6 +994,7 @@ static int lock_run_sqlite(const char *userid, const char *fname,
388f6b
         fprintf(stderr, "unable to lock %s: %s\n",
388f6b
                 userid ? userid : fname,
388f6b
                 error_message(r));
388f6b
+        r = backup_close(&backup);
388f6b
         return EC_SOFTWARE;
388f6b
     }
388f6b
 
388f6b
@@ -1053,6 +1055,7 @@ static int lock_run_exec(const char *userid, const char *fname,
388f6b
         fprintf(stderr, "unable to lock %s: %s\n",
388f6b
                 userid ? userid : fname,
388f6b
                 error_message(r));
388f6b
+        r = backup_close(&backup);
388f6b
         return EC_SOFTWARE;
388f6b
     }
388f6b