Skip to content

Commit

Permalink
mktree: fix a memory leak in write_tree()
Browse files Browse the repository at this point in the history
We forget to call strbuf_release to release the buf memory.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Liu Yuan authored and Junio C Hamano committed Nov 10, 2011
1 parent d52bc66 commit cd9519b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mktree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]";
Expand Down

0 comments on commit cd9519b

Please sign in to comment.