diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-06-11 11:20:09 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-06-11 13:15:06 -0700 |
commit | 3199b22e7d8cf8a95b7fac4e4aaf65638256b226 (patch) | |
tree | 07979b04cb6473442278afad4a84aacb60ee4b1a /diff.c | |
parent | 9e903a5531f239a1ff3ab5fec2f0bb6fda595010 (diff) |
builtin/merge-recursive: fix leaking object ID bases
In `cmd_merge_recursive()` we have a static array of object ID bases
that we pass to `merge_recursive_generic()`. This interface is somewhat
weird though because the latter function accepts a pointer to a pointer
of object IDs, which requires us to allocate the object IDs on the heap.
And as we never free those object IDs, the end result is a leak.
While we can easily solve this leak by just freeing the respective
object IDs, the whole calling convention is somewhat weird. Instead,
refactor `merge_recursive_generic()` to accept a plain pointer to object
IDs so that we can avoid allocating them altogether.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
0 files changed, 0 insertions, 0 deletions