]> git.ipfire.org Git - thirdparty/git.git/commit
config: clarify memory ownership in `git_config_pathname()`
authorPatrick Steinhardt <ps@pks.im>
Mon, 27 May 2024 11:46:15 +0000 (13:46 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 May 2024 18:19:59 +0000 (11:19 -0700)
commit6073b3b5c37716c50244d635e7c358f41f43e286
tree6d3663eeb79e31b729d5a51ef9028ccb58848d3e
parentf962ffc392fe1831d047a10a28a55710d987d746
config: clarify memory ownership in `git_config_pathname()`

The out parameter of `git_config_pathname()` is a `const char **` even
though we transfer ownership of memory to the caller. This is quite
misleading and has led to many memory leaks all over the place. Adapt
the parameter to instead be `char **`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
18 files changed:
builtin/blame.c
builtin/commit.c
builtin/config.c
builtin/log.c
builtin/receive-pack.c
config.c
config.h
diff.c
environment.c
environment.h
fetch-pack.c
fsck.c
fsmonitor-settings.c
gpg-interface.c
http.c
mailmap.c
mailmap.h
setup.c