From a1bb570de97c71eba3c1b7a067063e8ba28c41d5 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Tue, 28 Sep 2010 21:27:32 +0000
Subject: [PATCH] Fix leak patch that was using fclose() instead of close().

---
 contrib/pg_upgrade/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/pg_upgrade/file.c b/contrib/pg_upgrade/file.c
index 473b029d0ae..983a2b2d988 100644
--- a/contrib/pg_upgrade/file.c
+++ b/contrib/pg_upgrade/file.c
@@ -75,7 +75,7 @@ copyAndUpdateFile(migratorContext *ctx, pageCnvCtx *pageConverter,
 
 			if ((dstfd = open(dst, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR)) < 0)
 			{
-				fclose(src_fd);
+				close(src_fd);
 				return "can't create destination file";
 			}
 
-- 
GitLab