diff mbox series

[v4,20/19] branch: the ref_filter is not cleaned

Message ID xmqq1qns8gz4.fsf_-_@gitster.g (mailing list archive)
State Superseded
Headers show
Series leak fixes: various simple leak fixes | expand

Commit Message

Junio C Hamano Jan. 18, 2023, 7 a.m. UTC
Recently, a test that uses "branch --point-at" was marked
(incorrectly) as passing the leak tests, but it was premature.

As there is no API support to release the resource held by the
ref_filter structure when we are done, let's mark the singleton
instance that does not grow unbounded as such with UNLEAK() to
squelch pointless leak checker errors.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/branch.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/builtin/branch.c b/builtin/branch.c
index f63fd45edb..4fe7757670 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -742,6 +742,7 @@  int cmd_branch(int argc, const char **argv, const char *prefix)
 	if (filter.abbrev == -1)
 		filter.abbrev = DEFAULT_ABBREV;
 	filter.ignore_case = icase;
+	UNLEAK(filter);
 
 	finalize_colopts(&colopts, -1);
 	if (filter.verbose) {