Commit 3199b22
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>1 parent 9e903a5 commit 3199b22
File tree
6 files changed
+12
-12
lines changed- builtin
- t
6 files changed
+12
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1573 | 1573 | | |
1574 | 1574 | | |
1575 | 1575 | | |
1576 | | - | |
1577 | | - | |
| 1576 | + | |
| 1577 | + | |
1578 | 1578 | | |
1579 | 1579 | | |
1580 | 1580 | | |
| |||
1588 | 1588 | | |
1589 | 1589 | | |
1590 | 1590 | | |
1591 | | - | |
| 1591 | + | |
1592 | 1592 | | |
1593 | 1593 | | |
1594 | 1594 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
| 52 | + | |
54 | 53 | | |
55 | | - | |
56 | 54 | | |
57 | 55 | | |
58 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3866 | 3866 | | |
3867 | 3867 | | |
3868 | 3868 | | |
3869 | | - | |
| 3869 | + | |
3870 | 3870 | | |
3871 | 3871 | | |
3872 | 3872 | | |
| |||
3879 | 3879 | | |
3880 | 3880 | | |
3881 | 3881 | | |
3882 | | - | |
3883 | | - | |
| 3882 | + | |
| 3883 | + | |
3884 | 3884 | | |
3885 | | - | |
| 3885 | + | |
3886 | 3886 | | |
3887 | 3887 | | |
3888 | 3888 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
0 commit comments