threads / patch / 58824

patchlist-objects-filter: plug combine_filter_data leak

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

## tl;dr

One message between Nov 20, 2022 and Nov 20, 2022. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

René Scharfe· Nov 20, 2022, 11:00 UTC · lore

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(+)
Show changes to list-objects-filter.c +1 −1
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

← back to recent threads