config.c: fix mmap leak when writing config
commit3a1b3126ed5a0b51d5b1fdba827c92bf2acf5fc6
authorJeff King <peff@peff.net>
Thu, 28 May 2015 07:54:43 +0000 (28 03:54 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 28 May 2015 18:32:04 +0000 (28 11:32 -0700)
tree1818bbab5184b0774adb19b3fc6606e07f0d3256
parenta1293ef7c3690829a6ac47fc45f3f26b96b5c9f5
config.c: fix mmap leak when writing config

We mmap the existing config file, but fail to unmap it if we
hit an error. The function already has a shared exit path,
so we can fix this by moving the mmap pointer to the
function scope and clearing it in the shared exit.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config.c