list-objects-filter: plug pattern_list leak

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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe 2022-12-01 18:49:41 +01:00 committed by Junio C Hamano
parent e7e5c6f715
commit faebba436e

View File

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