Skip to content

Commit

Permalink
update-index: fix a memleak
Browse files Browse the repository at this point in the history
`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>
  • Loading branch information
Stefan Beller authored and Junio C Hamano committed Mar 22, 2015
1 parent 2d9426b commit 1b7cb89
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions builtin/update-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1b7cb89

Please sign in to comment.