summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2ebc02d)
raw | patch | inline | side by side (parent: 2ebc02d)
author | Stephan Beyer <s-beyer@gmx.net> | |
Mon, 11 Aug 2008 22:35:11 +0000 (00:35 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 17 Aug 2008 23:27:17 +0000 (16:27 -0700) |
The commit_tree() strbuf has a minimum size of 8k and it has not been
released yet. This patch releases the buffer.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
released yet. This patch releases the buffer.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-commit-tree.c | patch | blob | history |
diff --git a/builtin-commit-tree.c b/builtin-commit-tree.c
index 7a9a309be0543da7d27e7710ef82271f2582e0a9..f773db596c50430fa5223e3273b4fade32a0da34 100644 (file)
--- a/builtin-commit-tree.c
+++ b/builtin-commit-tree.c
int commit_tree(const char *msg, unsigned char *tree,
struct commit_list *parents, unsigned char *ret)
{
+ int result;
int encoding_is_utf8;
struct strbuf buffer;
if (encoding_is_utf8 && !is_utf8(buffer.buf))
fprintf(stderr, commit_utf8_warn);
- return write_sha1_file(buffer.buf, buffer.len, commit_type, ret);
+ result = write_sha1_file(buffer.buf, buffer.len, commit_type, ret);
+ strbuf_release(&buffer);
+ return result;
}
int cmd_commit_tree(int argc, const char **argv, const char *prefix)