diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-08-16 12:45:03 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-08-16 09:46:25 -0700 |
commit | 0ce44e2293352bc3636d93c156fbc2a1ebac0e45 (patch) | |
tree | 8cf86d404f7e40c185a8ef8108f96ed63ee07575 /diff-lib.c | |
parent | d1ae15d68b44af4ef6e6caedb7aa2b2dcce03c02 (diff) |
builtin/gc: fix leaking config values
We're leaking config values in git-gc(1) when those values are tracked
as strings. Introduce a new `gc_config_release()` function that releases
this memory to plug those leaks and release old values before populating
the config fields via `git_config_string()` et al.
Note that there is one small gotcha here with the "--prune" option. Next
to passing a string, this option also accepts the "--no-prune" option
that overrides the default or configured value. We thus need to discern
between the option not having been passed by the user and the negative
variant of it. This is done by using a simple sentinel value that lets
us discern these cases.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-lib.c')
0 files changed, 0 insertions, 0 deletions