From e5fb028688f5811bd835c0bc47f8d7a379a0d152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Wed, 20 Oct 2021 20:27:20 +0200 Subject: ref-filter API user: add and use a ref_sorting_release() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Junio C Hamano --- ref-filter.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ref-filter.h') diff --git a/ref-filter.h b/ref-filter.h index b636f4389d..6228458d30 100644 --- a/ref-filter.h +++ b/ref-filter.h @@ -127,6 +127,8 @@ void parse_ref_sorting(struct ref_sorting **sorting_tail, const char *atom); int parse_opt_ref_sorting(const struct option *opt, const char *arg, int unset); /* Default sort option based on refname */ struct ref_sorting *ref_default_sorting(void); +/* Release a "struct ref_sorting" */ +void ref_sorting_release(struct ref_sorting *); /* Function to parse --merged and --no-merged options */ int parse_opt_merge_filter(const struct option *opt, const char *arg, int unset); /* Get the current HEAD's description */ -- cgit v1.2.3