[PATCH 04/15] update-index: fix a memleak
- From
Stefan Beller <sbeller@google.com>
- Date
- Mar 21, 2015, 00:28 UTC
- Message-ID
- <1426897692-18322-5-git-send-email-sbeller@google.com>
- In-Reply-To
- <1426897692-18322-1-git-send-email-sbeller@google.com>
`old` is not used outside the loop and would get lost once we reach the goto.
Signed-off-by: Stefan Beller <sbeller@google.com> --- builtin/update-index.c | 1 + 1 file changed, 1 insertion(+)
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; }
-- 2.3.0.81.gc37f363