config.c: fix mmap leak when writing config
authorJeff King <redacted>
Thu, 28 May 2015 07:54:43 +0000 (03:54 -0400)
committerJunio C Hamano <redacted>
Thu, 28 May 2015 18:32:04 +0000 (11:32 -0700)
commit3a1b3126ed5a0b51d5b1fdba827c92bf2acf5fc6
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
config.c
git clone https://git.99rst.org/PROJECT