On Sat, Jan 11, 2020 at 9:55 AM Marc-André Lureau <marcandre.lureau@xxxxxxxxx> wrote: > On Sat, Jan 11, 2020 at 5:28 PM Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote: > > On Sat, Jan 11, 2020 at 7:36 AM <marcandre.lureau@xxxxxxxxxx> 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'? > > > 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.