diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-10-20 20:27:20 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-10-20 11:36:13 -0700 |
commit | e5fb028688f5811bd835c0bc47f8d7a379a0d152 (patch) | |
tree | a9e8e75d8139818d8f39240d5ef5bb9ce27ac179 /ref-filter.c | |
parent | 37766b61cdb3e12709febcd2f9dbee2b90e62969 (diff) | |
download | git-e5fb028688f5811bd835c0bc47f8d7a379a0d152.tar.gz |
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>
Diffstat (limited to 'ref-filter.c')
-rw-r--r-- | ref-filter.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ref-filter.c b/ref-filter.c index add429be79..282cdad103 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -2705,6 +2705,15 @@ int parse_opt_ref_sorting(const struct option *opt, const char *arg, int unset) return 0; } +void ref_sorting_release(struct ref_sorting *sorting) +{ + while (sorting) { + struct ref_sorting *next = sorting->next; + free(sorting); + sorting = next; + } +} + int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset) { struct ref_filter *rf = opt->value; |