git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] list-objects-filter: plug combine_filter_data leak

From
René Scharfe <l.s.r@web.de>
Date
Nov 20, 2022, 11:00 UTC
Message-ID
<bc25ac8c-ce9a-2385-be0d-0c72798d319d@web.de>

filter_combine__init() allocates a struct combine_filter_data object and assigns it to the filter_data member of struct filter_options. Release it in the complementing filter_combine__free().

Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
---
Reported in https://lore.kernel.org/git/221112.86bkpcmm6i.gmgdl@evledraar.gmail.com/
 list-objects-filter.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/list-objects-filter.c b/list-objects-filter.c
index 1c1ee3d1bb..b9543545ca 100644
--- a/list-objects-filter.c
+++ b/list-objects-filter.c
@@ -709,6 +709,7 @@ static void filter_combine__free(void *filter_data)
 			BUG("expected oidset to be cleared already");
 	}
 	free(d->sub);
+	free(d);
 }

 static void add_all(struct oidset *dest, struct oidset *src) {
--
2.38.1
Message 1 of 1 in “list-objects-filter: plug combine_filter_data leak”
  1. list-objects-filter: plug combine_filter_data leakRené Scharfe, Nov 20, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.