config: clarify memory ownership in `git_config_string()`
commit1b261c20ed28ad26ddbcd3dff94a248ac6866ac8
authorPatrick Steinhardt <ps@pks.im>
Mon, 27 May 2024 11:46:39 +0000 (27 13:46 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 May 2024 18:20:00 +0000 (27 11:20 -0700)
tree2b035eeafac8bc875b83bc643a0bff20aedd53c3
parent83024d98f78684fce3d4d0598e6b2b147a4b2ffa
config: clarify memory ownership in `git_config_string()`

The out parameter of `git_config_string()` 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>
30 files changed:
alias.c
attr.c
attr.h
builtin/commit.c
builtin/log.c
builtin/merge.c
builtin/rebase.c
builtin/receive-pack.c
builtin/repack.c
config.c
config.h
convert.c
delta-islands.c
diff.c
environment.c
environment.h
gpg-interface.c
http.c
imap-send.c
mailmap.c
mailmap.h
merge-ll.c
pager.c
pretty.c
promisor-remote.h
remote.c
remote.h
sequencer.c
upload-pack.c
userdiff.h