Browse Source

mktree: fix a memory leak in write_tree()

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>
maint
Liu Yuan 13 years ago committed by Junio C Hamano
parent
commit
cd9519bd2c
  1. 1
      mktree.c

1
mktree.c

@ -61,6 +61,7 @@ static void write_tree(unsigned char *sha1) @@ -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]";

Loading…
Cancel
Save