提交 5b8a94b1 编写于 作者: B Björn Steinbrink 提交者: Junio C Hamano

git cat-file: Fix memory leak in batch mode

When run in batch mode, git cat-file never frees the memory for the blob
contents it is printing. This quickly adds up and causes git-svn to be
hardly usable for imports of large svn repos, because it uses cat-file in
batch mode and cat-file's memory usage easily reaches several hundred MB
without any good reason.
Signed-off-by: NBjörn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 762656e0
......@@ -181,6 +181,7 @@ static int batch_one_object(const char *obj_name, int print_contents)
write_or_die(1, contents, size);
printf("\n");
fflush(stdout);
free(contents);
}
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册