ref-filter API user: add and use a ref_sorting_release()

Add a ref_sorting_release() and use it for some of the current API
users, the ref_sorting_default() function and its siblings will do a
malloc() which wasn't being free'd previously.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ævar Arnfjörð Bjarmason
2021-10-20 20:27:20 +02:00
committed by Junio C Hamano
parent 37766b61cd
commit e5fb028688
4 changed files with 13 additions and 1 deletions

View File

@ -96,6 +96,6 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
ref_array_clear(&array);
free_commit_list(filter.with_commit);
free_commit_list(filter.no_commit);
UNLEAK(sorting);
ref_sorting_release(sorting);
return 0;
}