Re: [PATCH v2 1/2] builtin/merge-base: UNLEAK commit lists

2017-11-06 Thread Jeff King
On Sun, Nov 05, 2017 at 09:26:30PM +0100, Martin Ågren wrote: > In several functions, we iterate through a commit list by assigning > `result = result->next`. As a consequence, we lose the original pointer > and eventually leak the list. > > These are immediate helpers to `cmd_merge_base()` which

Re: [PATCH v2 1/2] builtin/merge-base: UNLEAK commit lists

2017-11-05 Thread Junio C Hamano
Martin Ågren writes: > In several functions, we iterate through a commit list by assigning > `result = result->next`. As a consequence, we lose the original pointer > and eventually leak the list. > > These are immediate helpers to `cmd_merge_base()` which is just about to > return, so we can use

[PATCH v2 1/2] builtin/merge-base: UNLEAK commit lists

2017-11-05 Thread Martin Ågren
In several functions, we iterate through a commit list by assigning `result = result->next`. As a consequence, we lose the original pointer and eventually leak the list. These are immediate helpers to `cmd_merge_base()` which is just about to return, so we can use UNLEAK. For example, we could `UN