Skip to content

Commit abcac2e

Browse files
rjustogitster
authored andcommitted
ref-filter.c: fix a leak in get_head_description
In 2708ce6 (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 962dd7e (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 <[email protected]> Reviewed-by: Martin Ågren <[email protected]> Acked-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5b1c746 commit abcac2e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ref-filter.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,6 +1571,8 @@ char *get_head_description(void)
15711571
} else
15721572
strbuf_addstr(&desc, _("(no branch)"));
15731573

1574+
wt_status_state_free_buffers(&state);
1575+
15741576
return strbuf_detach(&desc, NULL);
15751577
}
15761578

0 commit comments

Comments
 (0)