Re: [PATCH] ref-filter.c: fix a leak in get_head_description

2 messages, 2 authors, 2022-09-27 · open the first message on its own page

Re: [PATCH] ref-filter.c: fix a leak in get_head_description

From: Junio C Hamano <hidden>
Date: 2022-09-26 19:12:34

Martin Ågren [off-list ref] writes:
On Sun, 25 Sept 2022 at 00:53, Rubén Justo [off-list ref] wrote:
quoted
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.
quoted
+       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 <redacted>

[1] https://lore.kernel.org/git/20210106100139.14651-1-avarab@gmail.com/

Martin
Thanks, all.  Will queue lest I forget, but I presume this is not
release critical?

Re: [PATCH] ref-filter.c: fix a leak in get_head_description

From: Martin Ågren <hidden>
Date: 2022-09-27 06:00:09

On Mon, 26 Sept 2022 at 21:12, Junio C Hamano [off-list ref] wrote:
Thanks, all.  Will queue lest I forget, but I presume this is not
release critical?
Correct. This regressed already in v2.30.1 and v2.31.0 after the leak
was originally plugged in v2.29.0. So almost all recentish releases have
this minor leak. I'm not even sure it's possible for a single git
process to hit this leak more than once today.

Martin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help