Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubén Justo <rjusto@gmail.com>2022-09-25 01:53:18 +0300
committerJunio C Hamano <gitster@pobox.com>2022-09-26 21:14:49 +0300
commitabcac2e19faaa0c64693533c9ee368dd4fd581f4 (patch)
tree0fddbccb3720383e81f7f58396415c11c0e8ea5d /ref-filter.c
parent5b1c746c352e85211770e5cbd26a433b3affd3b4 (diff)
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>
Diffstat (limited to 'ref-filter.c')
-rw-r--r--ref-filter.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ref-filter.c b/ref-filter.c
index f0bd32f714..bc4d2e7dac 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -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);
}