Commit 3a1b312
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>1 parent a1293ef commit 3a1b312
1 file changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1934 | 1934 | | |
1935 | 1935 | | |
1936 | 1936 | | |
| 1937 | + | |
| 1938 | + | |
1937 | 1939 | | |
1938 | 1940 | | |
1939 | 1941 | | |
| |||
1983 | 1985 | | |
1984 | 1986 | | |
1985 | 1987 | | |
1986 | | - | |
1987 | | - | |
| 1988 | + | |
1988 | 1989 | | |
1989 | 1990 | | |
1990 | 1991 | | |
| |||
2103 | 2104 | | |
2104 | 2105 | | |
2105 | 2106 | | |
2106 | | - | |
2107 | | - | |
2108 | 2107 | | |
2109 | 2108 | | |
2110 | 2109 | | |
| |||
2130 | 2129 | | |
2131 | 2130 | | |
2132 | 2131 | | |
| 2132 | + | |
| 2133 | + | |
2133 | 2134 | | |
2134 | 2135 | | |
2135 | 2136 | | |
| |||
0 commit comments