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

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

From
René Scharfe <l.s.r@web.de>
Date
Dec 1, 2022, 17:49 UTC
Message-ID
<b4361c3e-852b-e30c-f240-86c34bc9c474@web.de>

filter_sparse_oid__init() uses add_patterns_from_blob_to_list() to populate the struct pattern_list member of struct filter_sparse_data. Release it in the complementing filter_sparse_free().

Signed-off-by: René Scharfe <l.s.r@web.de>
---
 list-objects-filter.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/list-objects-filter.c b/list-objects-filter.c
index b9543545ca..dfc3f49f4f 100644
--- a/list-objects-filter.c
+++ b/list-objects-filter.c
@@ -514,6 +514,7 @@ static enum list_objects_filter_result filter_sparse(
 static void filter_sparse_free(void *filter_data)
 {
 	struct filter_sparse_data *d = filter_data;
+	clear_pattern_list(&d->pl);
 	free(d->array_frame);
 	free(d);
 }
--
2.30.2
Message 1 of 1 in “list-objects-filter: plug pattern_list leak”
  1. list-objects-filter: plug pattern_list leakRené Scharfe, Dec 1, 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.