There's no need for us to write this loop manually when a helper function can already do it. Signed-off-by: Jeff King <peff@xxxxxxxx> --- fetch-pack.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fetch-pack.c b/fetch-pack.c index e69993b2eb..a181d3401d 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -630,10 +630,7 @@ static void filter_refs(struct fetch_pack_args *args, } oidset_clear(&tip_oids); - for (ref = unmatched; ref; ref = next) { - next = ref->next; - free(ref); - } + free_refs(unmatched); *refs = newlist; } -- 2.21.0.931.gd0bc72a411