Blame SOURCES/0007-loadconv-Add-missing-fclose.patch

87bfed
From 1c97e4df9e01c5f22a12fb6ecce25b4d80fd8f7c Mon Sep 17 00:00:00 2001
87bfed
From: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
87bfed
Date: Mon, 13 Aug 2018 14:39:48 +0200
87bfed
Subject: [PATCH 7/7] loadconv: Add missing fclose()
87bfed
MIME-Version: 1.0
87bfed
Content-Type: text/plain; charset=UTF-8
87bfed
Content-Transfer-Encoding: 8bit
87bfed
87bfed
Issue found and reported by David Binderman.
87bfed
87bfed
This is a backport of commit f66b5c78.
87bfed
87bfed
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
87bfed
---
87bfed
 src/config.c | 6 ++++--
87bfed
 1 file changed, 4 insertions(+), 2 deletions(-)
87bfed
87bfed
diff --git a/src/config.c b/src/config.c
87bfed
index 36b6e37..0da4989 100644
87bfed
--- a/src/config.c
87bfed
+++ b/src/config.c
87bfed
@@ -1865,6 +1865,7 @@ void doconv(void)
87bfed
 int loadconv(char *buf)
87bfed
 {
87bfed
   FILE *fp;
87bfed
+  int err = 0;
87bfed
 
87bfed
   if ((fp = fopen(pfix_home(buf), "rb")) == (FILE *)NULL) {
87bfed
     werror(_("Cannot open conversion table %s"), pfix_home(buf));
87bfed
@@ -1874,10 +1875,11 @@ int loadconv(char *buf)
87bfed
       || fread(vt_outmap, sizeof(vt_outmap), (size_t)1, fp) != 1)
87bfed
     {
87bfed
       werror(_("Cannot read conversion table %s"), pfix_home(buf));
87bfed
-      return 1;
87bfed
+      err = 1;
87bfed
     }
87bfed
+
87bfed
   fclose(fp);
87bfed
-  return 0;
87bfed
+  return err;
87bfed
 }
87bfed
 
87bfed
 int saveconv(char *buf)
87bfed
-- 
87bfed
2.14.4
87bfed