update-index: fix cache entry leak in add_one_file()
commitbaddc96b2cbf66fdcde87509392dc8da6a77f452
authorJeff King <peff@peff.net>
Tue, 5 Sep 2017 13:04:14 +0000 (5 09:04 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Sep 2017 09:06:26 +0000 (6 18:06 +0900)
treeee56f396652711e330338db066b2a3babf3f2b07
parentfe6a01af8aa913fc23c1486251da6f6f08601816
update-index: fix cache entry leak in add_one_file()

When we fail to add the cache entry to the index, we end up
just leaking the struct. We should follow the pattern of the
early-return above and free it.

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