Thread (151 messages) 151 messages, 6 authors, 2017-05-11
STALE3346d

[PATCH 08/26] difftool: close file descriptors after reading

From: Johannes Schindelin <hidden>
Date: 2017-04-26 20:20:06
Subsystem: the rest · Maintainer: Linus Torvalds

Spotted by Coverity.

Signed-off-by: Johannes Schindelin <redacted>
---
 builtin/difftool.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/builtin/difftool.c b/builtin/difftool.c
index 1354d0e4625..a4f1d117ef6 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -226,6 +226,7 @@ static void changed_files(struct hashmap *result, const char *index_path,
 		hashmap_entry_init(entry, strhash(buf.buf));
 		hashmap_add(result, entry);
 	}
+	fclose(fp);
 	if (finish_command(&diff_files))
 		die("diff-files did not exit properly");
 	strbuf_release(&index_env);
@@ -497,6 +498,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
 		}
 	}
 
+	fclose(fp);
 	if (finish_command(&child)) {
 		ret = error("error occurred running diff --raw");
 		goto finish;
-- 
2.12.2.windows.2.800.gede8f145e06

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help