diff mbox series

list-objects-filter: plug pattern_list leak

Message ID b4361c3e-852b-e30c-f240-86c34bc9c474@web.de (mailing list archive)
State Accepted
Commit faebba436e6d8a274acfc5a3cc3fd4b6c2495d80
Headers show
Series list-objects-filter: plug pattern_list leak | expand

Commit Message

René Scharfe Dec. 1, 2022, 5:49 p.m. UTC
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(+)

--
2.30.2
diff mbox series

Patch

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);
 }