Re: [PATCH 3/7] worktree move: new command
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Feb 5, 2018, 13:28 UTC
- Message-ID
- <CACsJy8A+zMTC2N8Y0Ua-KyLF6Wp2oHL=8mbsSXck6mKZGG=37g@mail.gmail.com>
- In-Reply-To
- <CAPig+cRYL6-jEgsQoiQokNSd0zq5zoFkMHBA0Vp9kqa0LvMnsA@mail.gmail.com>
On Fri, Feb 2, 2018 at 6:23 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 15 quoted lines
> On Fri, Feb 2, 2018 at 4:15 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>> On Wed, Jan 24, 2018 at 4:53 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
>>> +static int move_worktree(int ac, const char **av, const char *prefix)
>>> +{
>>> + [...]
>>> + worktrees = get_worktrees(0);
>>> + wt = find_worktree(worktrees, prefix, av[0]);
>>> + if (!wt)
>>> + die(_("'%s' is not a working tree"), av[0]);
>>
>> This is still leaking 'worktrees'[1]. You probably want
>> free_worktrees() immediately after the find_worktree() invocation.
>
> Sorry, free_worktrees() after the last use of 'wt' since you still
> need to access its fields, which would be the end of the function.I learned SANITIZE=leak today! It not only catches this but also "dst".
Jeff is there any ongoing effort to make the test suite pass with SANITIZE=leak? My t2038 passed, so I went ahead with the full test suite and saw so many failures. I did see in your original mails that you focused on t0000 and t0001 only..
-- Duy