am: fix commit buffer leak in get_commit_info()
commitf131db9e3166c528d3b0352b653eb0d9deca5a65
authorJeff King <peff@peff.net>
Thu, 27 Apr 2017 03:25:55 +0000 (26 23:25 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 27 Apr 2017 05:38:50 +0000 (27 14:38 +0900)
tree8b72fbb01f8e7999222e1e74deede4fc8ddf7641
parent3b9e3c2cede15057af3ff8076c45ad5f33829436
am: fix commit buffer leak in get_commit_info()

Calling logmsg_reencode() may allocate a buffer for the
commit message (because we need to load it from disk, or
because it needs re-encoded). We must "unuse" it afterwards
to free it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c