diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-11-05 07:17:49 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-11-04 22:37:57 -0800 |
commit | ff67083ccd77dc80002751c0f81ac50e122abd6c (patch) | |
tree | cf5e4420cf5fd5280184afdb2544bb6f4fdf9a68 /t/helper/test-submodule-nested-repo-config.c | |
parent | 813b12b6f74d75ce5ad2e7453fb763a4db44bdf8 (diff) |
builtin/merge: release output buffer after performing merge
The `obuf` member of `struct merge_options` is used to buffer output in
some cases. In order to not discard its allocated memory we only release
its contents in `merge_finalize()` when we're not currently recursing
into a subtree.
This results in some situations where we seemingly do not release the
buffer reliably. We thus have calls to `strbuf_release()` for this
buffer scattered across the codebase. But we're missing one callsite in
git-merge(1), which causes a memory leak.
We should ideally refactor this interface so that callers don't have to
know about any such internals. But for now, paper over the issue by
adding one more `strbuf_release()` call.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-submodule-nested-repo-config.c')
0 files changed, 0 insertions, 0 deletions