http: refactor code to clarify memory ownership
commitf962ffc392fe1831d047a10a28a55710d987d746
authorPatrick Steinhardt <ps@pks.im>
Mon, 27 May 2024 11:46:10 +0000 (27 13:46 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 May 2024 18:19:58 +0000 (27 11:19 -0700)
tree79311810bd80323f23a67d859aff91c2d9aa8ae0
parentcc395d6b47e4af59b3e87a64b34dffa79e8dc262
http: refactor code to clarify memory ownership

There are various variables assigned via `git_config_string()` and
`git_config_pathname()` which are never free'd. This bug is relatable
because the out parameter of those functions are a `const char **`, even
though memory ownership is transferred to the caller.

We're about to adapt the functions to instead use `char **`. Prepare the
code accordingly. Note that the `(const char **)` casts will go away
once we have adapted the functions.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http.c