Skip to content

Commit cd9519b

Browse files
liuygitster
authored andcommitted
mktree: fix a memory leak in write_tree()
We forget to call strbuf_release to release the buf memory. Signed-off-by: Liu Yuan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d52bc66 commit cd9519b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mktree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ static void write_tree(unsigned char *sha1)
6161
}
6262

6363
write_sha1_file(buf.buf, buf.len, tree_type, sha1);
64+
strbuf_release(&buf);
6465
}
6566

6667
static const char mktree_usage[] = "git-mktree [-z]";

0 commit comments

Comments
 (0)