name-rev: avoid leaking memory in the `deref` case
commit5308224633cf138f436357b2a8a87a546373af72
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 4 May 2017 13:59:06 +0000 (4 15:59 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 May 2017 03:18:20 +0000 (8 12:18 +0900)
tree38df10b117d95a5a1f88df10fd8128d8da67450e
parent3dc7ea91dab9959b6bec82c05df18d6d1bb70619
name-rev: avoid leaking memory in the `deref` case

When the `name_rev()` function is asked to dereference the tip name, it
allocates memory. But when it turns out that another tip already
described the commit better than the current one, we forgot to release
the memory.

Pointed out by Coverity.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/name-rev.c