diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-11-20 14:39:31 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-11-21 00:23:40 +0100 |
commit | 79366add74529359dfb57a387090e9c5f9c74282 (patch) | |
tree | 97cdae18cc280b5397188a5b56eff7579e7b6b8b /bisect.h | |
parent | builtin/blame: fix leaking blame entries with `--incremental` (diff) | |
download | git-79366add74529359dfb57a387090e9c5f9c74282.tar.xz git-79366add74529359dfb57a387090e9c5f9c74282.zip |
bisect: fix leaking good/bad terms when reading multipe times
Even though `read_bisect_terms()` is declared as assigning string
constants, it in fact assigns allocated strings to the `read_bad` and
`read_good` out parameters. The only callers of this function assign the
result to global variables and thus don't have to free them in order to
be leak-free. But that changes when executing the function multiple
times because we'd then overwrite the previous value and thus make it
unreachable.
Fix the function signature and free the previous values. This leak is
exposed by t0630, but plugging it does not make the whole test suite
pass.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bisect.h')
-rw-r--r-- | bisect.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -75,7 +75,7 @@ enum bisect_error bisect_next_all(struct repository *r, const char *prefix); int estimate_bisect_steps(int all); -void read_bisect_terms(const char **bad, const char **good); +void read_bisect_terms(char **bad, char **good); int bisect_clean_state(void); |