summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-07-18 23:57:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-07-18 23:57:47 (GMT)
commit58b1ef2f0fce75ebf4fbf88e5bdf76a0afaeacce (patch)
treed88020de86478eeaa883f6626ba6a2f5fdd94e95 /refs.c
parent4525e8e41a8c0c4246a95097744604ea72198dad (diff)
parent78d3b06e0f5e6aaea001ee8e3e7c8e401dc4b244 (diff)
downloadgit-58b1ef2f0fce75ebf4fbf88e5bdf76a0afaeacce.zip
git-58b1ef2f0fce75ebf4fbf88e5bdf76a0afaeacce.tar.gz
git-58b1ef2f0fce75ebf4fbf88e5bdf76a0afaeacce.tar.bz2
Merge branch 'maint'
* maint: checkout -f: deal with a D/F conflict entry correctly sha1_name.c: avoid unnecessary strbuf_release refs.c: release file descriptor on error return
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/refs.c b/refs.c
index dffe395..e15880f 100644
--- a/refs.c
+++ b/refs.c
@@ -1525,8 +1525,10 @@ int for_each_recent_reflog_ent(const char *ref, each_reflog_ent_fn fn, long ofs,
if (fstat(fileno(logfp), &statbuf) ||
statbuf.st_size < ofs ||
fseek(logfp, -ofs, SEEK_END) ||
- fgets(buf, sizeof(buf), logfp))
+ fgets(buf, sizeof(buf), logfp)) {
+ fclose(logfp);
return -1;
+ }
}
while (fgets(buf, sizeof(buf), logfp)) {