fmt-merge-msg: plug small leak of commit buffer
[gitweb.git] / builtin / commit.c
index 9cfef6c6cca61973a4982763e4b834bf1b45cb75..8b85df475b2e266277aeffc79aaebaefc37f58b2 100644 (file)
@@ -1659,8 +1659,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
                append_merge_tag_headers(parents, &tail);
        }
 
-       if (commit_tree_extended(&sb, active_cache_tree->sha1, parents, sha1,
-                                author_ident.buf, sign_commit, extra)) {
+       if (commit_tree_extended(sb.buf, sb.len, active_cache_tree->sha1,
+                        parents, sha1, author_ident.buf, sign_commit, extra)) {
                rollback_index_files();
                die(_("failed to write commit object"));
        }