Blame SOURCES/0003-Fix-file-descriptor-leaks.patch

3f7af7
From abc0836d587862ba512acf4d4fafcf8cb121bf0a Mon Sep 17 00:00:00 2001
3f7af7
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
3f7af7
Date: Mon, 13 Aug 2018 14:39:44 +0200
3f7af7
Subject: [PATCH 3/7] Fix file descriptor leaks
3f7af7
MIME-Version: 1.0
3f7af7
Content-Type: text/plain; charset=UTF-8
3f7af7
Content-Transfer-Encoding: 8bit
3f7af7
3f7af7
Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
3f7af7
---
3f7af7
 src/dial.c | 5 +++++
3f7af7
 1 file changed, 5 insertions(+)
3f7af7
3f7af7
diff --git a/src/dial.c b/src/dial.c
3f7af7
index a3337e5..eada5ee 100644
3f7af7
--- a/src/dial.c
3f7af7
+++ b/src/dial.c
3f7af7
@@ -912,6 +912,7 @@ int readdialdir(void)
3f7af7
   if (fread(&dial_ver, sizeof(dial_ver), 1, fp) != 1)
3f7af7
     {
3f7af7
       werror(_("Failed to read dialing directory\n"));
3f7af7
+      fclose(fp);
3f7af7
       return -1;
3f7af7
     }
3f7af7
   if (dial_ver.magic != DIALMAGIC) {
3f7af7
@@ -947,12 +948,14 @@ int readdialdir(void)
3f7af7
           dial_ver.size > sizeof(struct v4_dialent)) {
3f7af7
         werror(_("Phonelist garbled (unknown version?)"));
3f7af7
         dialents = mkstdent();
3f7af7
+        fclose(fp);
3f7af7
         return -1;
3f7af7
       }
3f7af7
       break;
3f7af7
     case 5:
3f7af7
       if (dial_ver.size != sizeof(struct dialent)) {
3f7af7
 	werror(_("Phonelist corrupted"));
3f7af7
+        fclose(fp);
3f7af7
 	return -1;
3f7af7
       }
3f7af7
       break;
3f7af7
@@ -961,6 +964,7 @@ int readdialdir(void)
3f7af7
       // have different size on 32 and 64bit systems
3f7af7
       if (dial_ver.size != sizeof(struct dialent) - sizeof(void *)) {
3f7af7
         werror(_("Phonelist corrupted"));
3f7af7
+        fclose(fp);
3f7af7
         return -1;
3f7af7
       }
3f7af7
       break;
3f7af7
@@ -968,6 +972,7 @@ int readdialdir(void)
3f7af7
       werror(_("Unknown dialing directory version"));
3f7af7
       dendd = 1;
3f7af7
       dialents = mkstdent();
3f7af7
+      fclose(fp);
3f7af7
       return -1;
3f7af7
   }
3f7af7
 
3f7af7
-- 
3f7af7
2.14.4
3f7af7