summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
author李鸿 <leehong@pku.edu.cn>2007-12-16 04:53:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-12-16 20:50:08 (GMT)
commit6ba78238a824282816944550edc4297dd2808a72 (patch)
tree5ba9e78fb4dc58d378b4e12ff3be061fe057e033 /dir.c
parentbc8b95ae4a4b21753e84bbfd28cbcbf1b3f6e0a8 (diff)
downloadgit-6ba78238a824282816944550edc4297dd2808a72.zip
git-6ba78238a824282816944550edc4297dd2808a72.tar.gz
git-6ba78238a824282816944550edc4297dd2808a72.tar.bz2
Fix a memory leak
Signed-off-by: Li Hong <leehong@pku.edu.cn> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dir.c b/dir.c
index 6b3273d..3e345c2 100644
--- a/dir.c
+++ b/dir.c
@@ -169,7 +169,10 @@ static int add_excludes_from_file_1(const char *fname,
}
buf = xmalloc(size+1);
if (read_in_full(fd, buf, size) != size)
+ {
+ free(buf);
goto err;
+ }
close(fd);
if (buf_p)