read_branches_file: plug a FILE* leak
commit0fb19906b5eb8fff9af59531aacd023920a24495
authorJohannes Sixt <j6t@kdbg.org>
Fri, 23 Oct 2015 06:02:51 +0000 (23 08:02 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 23 Oct 2015 17:17:48 +0000 (23 10:17 -0700)
tree52d655816d0436cf5aeb673306b6ae4e61ce9317
parent34e02deb60b4db22243d47846eb926de9e0d1cf9
read_branches_file: plug a FILE* leak

The earlier rewrite f28e3ab2 (read_branches_file: simplify string handling)
of read_branches_file() lost an fclose() call. Put it back.

As on Windows files that are open cannot be removed, the leak manifests in
a failure of 'git remote rename origin origin' when the remote's URL is
specified in .git/branches/origin, because by the time that the command
attempts to remove this file, it is still open.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c