Re: [PATCH] ref-filter.c: fix a leak in get_head_description
- From
- Martin Ågren <martin.agren@gmail.com>
- Date
- Sep 26, 2022, 06:59 UTC
- Message-ID
- <CAN0heSra_LsBzYCNFh0cZOZ0pmk1Wb9RtNTLwi93UM=f-53Uxw@mail.gmail.com>
- In-Reply-To
- <6ff29e96-7f8d-c354-dced-b1b363e54467@gmail.com>
On Sun, 25 Sept 2022 at 00:53, Rubén Justo <rjusto@gmail.com> wrote:
Show 9 quoted lines
> > In 2708ce62d2 (branch: sort detached HEAD based on a flag, 2021-01-07) a > call to wt_status_state_free_buffers, responsible of freeing the > resources that could be allocated in the local struct wt_status_state > state, was eliminated. > > The call to wt_status_state_free_buffers was introduced in 962dd7ebc3 > (wt-status: introduce wt_status_state_free_buffers(), 2020-09-27). This > commit brings back that call in get_head_description.
> + wt_status_state_free_buffers(&state); > + > return strbuf_detach(&desc, NULL); > }
Good catch, and excellent history digging. From the original submission [1] of the patch that dropped this call, I get the feeling that it was originally developed some time earlier. I suspect this call was then accidentally dropped in a rebase before submission.
FWIW, this patch is
Reviewed-by: Martin Ågren <martin.agren@gmail.com>
[1] https://lore.kernel.org/git/20210106100139.14651-1-avarab@gmail.com/
Martin