From 1b7cb8969cb204b64b9f8ce25c86986e8144d352 Mon Sep 17 00:00:00 2001
From: Stefan Beller <sbeller@google.com>
Date: Fri, 20 Mar 2015 17:28:01 -0700
Subject: 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>
---
 builtin/update-index.c | 1 +
 1 file changed, 1 insertion(+)

(limited to 'builtin/update-index.c')

diff --git a/builtin/update-index.c b/builtin/update-index.c
index 587898624..6271b54ad 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;
 	}
-- 
cgit v1.2.1