aboutsummaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
author李鸿 <leehong@pku.edu.cn>2007-12-16 12:53:26 +0800
committerJunio C Hamano <gitster@pobox.com>2007-12-16 12:50:08 -0800
commit6ba78238a824282816944550edc4297dd2808a72 (patch)
tree5ba9e78fb4dc58d378b4e12ff3be061fe057e033 /dir.c
parentbc8b95ae4a4b21753e84bbfd28cbcbf1b3f6e0a8 (diff)
downloadgit-6ba78238a824282816944550edc4297dd2808a72.tar.gz
git-6ba78238a824282816944550edc4297dd2808a72.tar.xz
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 6b3273d1d..3e345c2fc 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)