mktree: fix a memory leak in write_tree()
[gitweb.git] / mktree.c
index 2e84889c02dd110caff0e896a6899f877ca863f1..bb23c4425b483317c3cbe4775c10b967a2822af4 100644 (file)
--- a/mktree.c
+++ b/mktree.c
@@ -61,6 +61,7 @@ static void write_tree(unsigned char *sha1)
        }
 
        write_sha1_file(buf.buf, buf.len, tree_type, sha1);
+       strbuf_release(&buf);
 }
 
 static const char mktree_usage[] = "git-mktree [-z]";