Fix a memory leak
Signed-off-by: Li Hong <leehong@pku.edu.cn> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
bc8b95ae4a
commit
6ba78238a8
3
dir.c
3
dir.c
|
@ -169,7 +169,10 @@ static int add_excludes_from_file_1(const char *fname,
|
||||||
}
|
}
|
||||||
buf = xmalloc(size+1);
|
buf = xmalloc(size+1);
|
||||||
if (read_in_full(fd, buf, size) != size)
|
if (read_in_full(fd, buf, size) != size)
|
||||||
|
{
|
||||||
|
free(buf);
|
||||||
goto err;
|
goto err;
|
||||||
|
}
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
if (buf_p)
|
if (buf_p)
|
||||||
|
|
Loading…
Reference in New Issue