X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=builtin-commit-tree.c;h=f773db596c50430fa5223e3273b4fade32a0da34;hb=a7b3269c4b9acde052d75b6dc54c8f869b77eb44;hp=7a9a309be0543da7d27e7710ef82271f2582e0a9;hpb=847d10f56d7853cd0e139a7c2e6ad0ad2de5c464;p=git.git diff --git a/builtin-commit-tree.c b/builtin-commit-tree.c index 7a9a309be..f773db596 100644 --- a/builtin-commit-tree.c +++ b/builtin-commit-tree.c @@ -48,6 +48,7 @@ static const char commit_utf8_warn[] = 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; @@ -86,7 +87,9 @@ int commit_tree(const char *msg, unsigned char *tree, 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)