Blame SOURCES/0001-After-fdopen-use-fclose-instead-of-close-in-error-pa.patch

cdf37b
From e00066fb973a1796dd3989e356e17c8b51add521 Mon Sep 17 00:00:00 2001
cdf37b
From: Alan Coopersmith <alan.coopersmith@oracle.com>
cdf37b
Date: Sun, 30 Sep 2018 15:09:29 -0700
cdf37b
Subject: [PATCH 1/3] After fdopen(), use fclose() instead of close() in error
cdf37b
 path
cdf37b
cdf37b
Found by Oracle's Parfait 2.2 static analyzer:
cdf37b
cdf37b
Error: File Leak
cdf37b
   File Leak [file-ptr-leak]:
cdf37b
      Leaked File fp
cdf37b
        at line 94 of lib/libXpm/src/RdFToBuf.c in function 'XpmReadFileToBuffer
cdf37b
'.
cdf37b
          fp initialized at line 86 with fdopen
cdf37b
          fp leaks when len < 0 at line 92.
cdf37b
cdf37b
Introduced-by: commit 8b3024e6871ce50b34bf2dff924774bd654703bc
cdf37b
cdf37b
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
cdf37b
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
cdf37b
---
cdf37b
 src/RdFToBuf.c | 2 +-
cdf37b
 1 file changed, 1 insertion(+), 1 deletion(-)
cdf37b
cdf37b
diff --git a/src/RdFToBuf.c b/src/RdFToBuf.c
cdf37b
index 69e3347d24f2..1b386f81fde3 100644
cdf37b
--- a/src/RdFToBuf.c
cdf37b
+++ b/src/RdFToBuf.c
cdf37b
@@ -90,7 +90,7 @@ XpmReadFileToBuffer(
cdf37b
     }
cdf37b
     len = stats.st_size;
cdf37b
     if (len < 0 || len >= SIZE_MAX) {
cdf37b
-	close(fd);
cdf37b
+	fclose(fp);
cdf37b
 	return XpmOpenFailed;
cdf37b
     }
cdf37b
     ptr = (char *) XpmMalloc(len + 1);
cdf37b
-- 
cdf37b
2.23.0
cdf37b