From 6ba78238a824282816944550edc4297dd2808a72 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E6=9D=8E=E9=B8=BF?= Date: Sun, 16 Dec 2007 12:53:26 +0800 Subject: [PATCH] Fix a memory leak Signed-off-by: Li Hong Signed-off-by: Junio C Hamano --- dir.c | 3 +++ 1 file changed, 3 insertions(+) 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) -- 2.26.2