Blame SOURCES/0010-src-transform.c-transform_save-fix-leaks-on-fchmod-f.patch

ee1b47
From 93c4dc92dfbc5fbca8fbda96dc68172430b7095e Mon Sep 17 00:00:00 2001
ee1b47
From: Pino Toscano <ptoscano@redhat.com>
ee1b47
Date: Fri, 20 Jul 2018 16:32:44 +0200
ee1b47
Subject: [PATCH] * src/transform.c (transform_save): fix leaks on fchmod fail
ee1b47
ee1b47
If fchmod fails, the early return prevents any cleanup of the function
ee1b47
resources, e.g. the open FILEs.  Use the common error handling instead.
ee1b47
ee1b47
(cherry picked from commit 4d1a3f3cd8d97f852c6e7c50942255d535ad1405)
ee1b47
---
ee1b47
 src/transform.c | 2 +-
ee1b47
 1 file changed, 1 insertion(+), 1 deletion(-)
ee1b47
ee1b47
diff --git a/src/transform.c b/src/transform.c
ee1b47
index 6a0ce858..176482b9 100644
ee1b47
--- a/src/transform.c
ee1b47
+++ b/src/transform.c
ee1b47
@@ -1258,7 +1258,7 @@ int transform_save(struct augeas *aug, struct tree *xfm,
ee1b47
 
ee1b47
         if (fchmod(fileno(fp), 0666 & ~curumsk) < 0) {
ee1b47
             err_status = "create_chmod";
ee1b47
-            return -1;
ee1b47
+            goto done;
ee1b47
         }
ee1b47
     }
ee1b47
 
ee1b47
-- 
ee1b47
2.17.2
ee1b47