summaryrefslogtreecommitdiff
path: root/builtin/update-index.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2015-03-21 00:28:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-03-22 19:26:31 (GMT)
commit1b7cb8969cb204b64b9f8ce25c86986e8144d352 (patch)
treefd4c098d47c379d39979058033efa8ce7d3927a7 /builtin/update-index.c
parent2d9426b049335c1a39be7ea7416094e944bfe63c (diff)
downloadgit-1b7cb8969cb204b64b9f8ce25c86986e8144d352.zip
git-1b7cb8969cb204b64b9f8ce25c86986e8144d352.tar.gz
git-1b7cb8969cb204b64b9f8ce25c86986e8144d352.tar.bz2
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 <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/update-index.c')
-rw-r--r--builtin/update-index.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 5878986..6271b54 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;
}