git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ref-filter.c: fix a leak in get_head_description
@ 2022-09-24 22:53 Rubén Justo
  2022-09-26  6:59 ` Martin Ågren
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Rubén Justo @ 2022-09-24 22:53 UTC (permalink / raw)
  To: git; +Cc: Ævar Arnfjörð Bjarmason, Martin Ågren

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>

---
 ref-filter.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ref-filter.c b/ref-filter.c
index fd1cb14b0f..914908fac5 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -1722,6 +1722,8 @@ char *get_head_description(void)
 	} else
 		strbuf_addstr(&desc, _("(no branch)"));
 
+	wt_status_state_free_buffers(&state);
+
 	return strbuf_detach(&desc, NULL);
 }
 
-- 
2.36.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-08  0:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-24 22:53 [PATCH] ref-filter.c: fix a leak in get_head_description Rubén Justo
2022-09-26  6:59 ` Martin Ågren
2022-09-26 19:12   ` Junio C Hamano
2022-09-27  5:59     ` Martin Ågren
2022-09-26  8:14 ` Ævar Arnfjörð Bjarmason
2022-09-26 19:13   ` Rubén Justo
2022-10-08  0:35 ` [PATCH v2] wt-status: using of wt_status_state_free_buffers Rubén Justo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).