]> git.ipfire.org Git - thirdparty/git.git/commitdiff
list-objects-filter: plug combine_filter_data leak
authorRené Scharfe <l.s.r@web.de>
Sun, 20 Nov 2022 11:00:52 +0000 (12:00 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Nov 2022 07:43:26 +0000 (16:43 +0900)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
list-objects-filter.c

index 1c1ee3d1bb18d1737bd9aded0472b899b1864459..b9543545ca4af96e062ec69546c354e318e4ad0d 100644 (file)
@@ -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) {