Re: [PATCH] branch: let '--edit-description' default to rebased branch during rebase
Hi Eric
On Sun, Jan 12, 2020 at 5:27 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 13 quoted lines
>
> On Sat, Jan 11, 2020 at 9:55 AM Marc-André Lureau
> <marcandre.lureau@gmail.com> wrote:
> > On Sat, Jan 11, 2020 at 5:28 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
> > > On Sat, Jan 11, 2020 at 7:36 AM <marcandre.lureau@redhat.com> wrote:
> > > > + if (wt_status_check_rebase(NULL, &state)) {
> > > > + branch_name = state.branch;
> > > > + }
>
> Taking a deeper look at the code, I'm wondering it would make more
> sense to call wt_status_get_state(), which handles 'rebase' and
> 'bisect'. Is there a reason that you limited this check to only
> 'rebase'?No reason, I just didn't try it yet. Done, thanks
Show 13 quoted lines
>
> > > > if (edit_branch_description(branch_name))
> > > > return 1;
> > > > +
> > > > + free(branch_name);
> > >
> > > That `return 1` just above this free() is leaking 'branch_name', isn't it?
> >
> > right, let's fix that too
>
> Looking at the code itself (rather than consulting only the patch), I
> see that there are a couple more early returns leaking 'branch_name',
> so they need to be handled, as well.
I think I covered them now, sending v4.
thanks
--
Marc-André Lureau