1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 12:59:41 +01:00

ref-filter.c: fix a leak in get_head_description

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.

Signed-off-by: Rubén Justo <rjusto@gmail.com>
Reviewed-by: Martin Ågren <martin.agren@gmail.com>
Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Rubén Justo 2022-09-25 00:53:18 +02:00 committed by Junio C Hamano
parent 5b1c746c35
commit abcac2e19f

View file

@ -1571,6 +1571,8 @@ char *get_head_description(void)
} else
strbuf_addstr(&desc, _("(no branch)"));
wt_status_state_free_buffers(&state);
return strbuf_detach(&desc, NULL);
}