summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcee1 <fykcee1@gmail.com>2015-07-09 13:52:16 +0800
committerDaniel Mack <daniel@zonque.org>2015-07-09 10:41:23 -0400
commitac5213569cd670131e2120f6f244108080818d6b (patch)
tree8273ced62aed743e820dba52a29f99feb8c9ce32 /src
parentd711ea2b95279b33c53e535723515b70bddbcc75 (diff)
basic/util.c fopen_temporary(): close fd if failed
Diffstat (limited to 'src')
-rw-r--r--src/basic/util.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/util.c b/src/basic/util.c
index e4e302ae3d..c88cd1d38a 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -2535,6 +2535,7 @@ int fopen_temporary(const char *path, FILE **_f, char **_temp_path) {
if (!f) {
unlink(t);
free(t);
+ safe_close(fd);
return -errno;
}