Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
author李鸿 <leehong@pku.edu.cn>2007-12-16 07:53:26 +0300
committerJunio C Hamano <gitster@pobox.com>2007-12-16 23:50:08 +0300
commit6ba78238a824282816944550edc4297dd2808a72 (patch)
tree5ba9e78fb4dc58d378b4e12ff3be061fe057e033 /dir.c
parentbc8b95ae4a4b21753e84bbfd28cbcbf1b3f6e0a8 (diff)
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 6b3273d1d1..3e345c2fc5 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)