diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-06-11 11:21:11 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-06-11 22:15:08 +0200 |
commit | 44ec7c575f914d77787a17cefd094e3c46b8b12b (patch) | |
tree | 185a726b608127146430586f18dcdbb77f981372 /line-range.c | |
parent | builtin/merge: fix leaking `struct cmdnames` in `get_strategy()` (diff) | |
download | git-44ec7c575f914d77787a17cefd094e3c46b8b12b.tar.xz git-44ec7c575f914d77787a17cefd094e3c46b8b12b.zip |
merge: fix leaking merge bases
When calling either the recursive or the ORT merge machineries we need
to provide a list of merge bases. The ownership of that parameter is
then implicitly transferred to the callee, which is somewhat fishy.
Furthermore, that list may leak in some cases where the merge machinery
runs into an error, thus causing a memory leak.
Refactor the code such that we stop transferring ownership. Instead, the
merge machinery will now create its own local copies of the passed in
list as required if they need to modify the list. Free the list at the
callsites as required.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'line-range.c')
0 files changed, 0 insertions, 0 deletions