Re: [PATCH v3 1/2] builtin/merge-base: free commit lists

2017-11-07 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. > > Rewrite the loops so that we keep the original pointers, then call > `free_commit_list()`. Vario

[PATCH v3 1/2] builtin/merge-base: free commit lists

2017-11-07 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. Rewrite the loops so that we keep the original pointers, then call `free_commit_list()`. Various alternatives were considered: