From: Stefan Beller Date: Sat, 21 Mar 2015 00:28:01 +0000 (-0700) Subject: update-index: fix a memleak X-Git-Tag: v2.4.0-rc1~9^2~8 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/1b7cb8969cb204b64b9f8ce25c86986e8144d352?ds=inline;hp=-c update-index: fix a memleak `old` is not used outside the loop and would get lost once we reach the goto. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- 1b7cb8969cb204b64b9f8ce25c86986e8144d352 diff --git a/builtin/update-index.c b/builtin/update-index.c index 587898624c..6271b54adc 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -584,6 +584,7 @@ static int do_reupdate(int ac, const char **av, path = xstrdup(ce->name); update_one(path); free(path); + free(old); if (save_nr != active_nr) goto redo; }