fb7efb
From f0bb84f7db0af57520521846ff782871fbbd6020 Mon Sep 17 00:00:00 2001
fb7efb
From: cee1 <fykcee1@gmail.com>
fb7efb
Date: Thu, 9 Jul 2015 13:52:16 +0800
fb7efb
Subject: [PATCH 06/47] basic/util.c fopen_temporary(): close fd if failed
fb7efb
fb7efb
---
fb7efb
 src/basic/util.c | 1 +
fb7efb
 1 file changed, 1 insertion(+)
fb7efb
fb7efb
diff --git a/src/basic/util.c b/src/basic/util.c
fb7efb
index aa912bd..100facb 100644
fb7efb
--- a/src/basic/util.c
fb7efb
+++ b/src/basic/util.c
fb7efb
@@ -2535,6 +2535,7 @@ int fopen_temporary(const char *path, FILE **_f, char **_temp_path) {
fb7efb
         if (!f) {
fb7efb
                 unlink(t);
fb7efb
                 free(t);
fb7efb
+                safe_close(fd);
fb7efb
                 return -errno;
fb7efb
         }
fb7efb
 
fb7efb
-- 
fb7efb
2.5.0
fb7efb