From: Matthieu Moy Date: Wed, 23 Sep 2015 19:00:53 GMT Subject: Re: [PATCH v6 0/8] port branch.c to use the filtering part of ref-filter. Message-ID: In-Reply-To: <1443031873-25280-1-git-send-email-Karthik.188@gmail.com> Karthik Nayak writes: > --- a/builtin/branch.c > +++ b/builtin/branch.c > @@ -479,8 +479,6 @@ static void print_ref_list(struct ref_filter *filter, struct ref_sorting *sortin > struct ref_array array; > int maxwidth = 0; > const char *remote_prefix = ""; > - struct ref_sorting def_sorting; > - const char *sort_type = "refname"; This was allocated on stack ... > @@ -498,12 +496,15 @@ static void print_ref_list(struct ref_filter *filter, struct ref_sorting *sortin > + if (!sorting) > + sorting = ref_default_sorting(); and it's now allocated by xcalloc within ref_default_sorting(). In theory, you need a free(). But the sensible place to add this free would be after the call to print_ref_list(), and this is right before the process terminates. So it's probably overkill to add a free(). The series looks good to me. I did a minor remark on PATCH 5/8 but this should not block inclusion. -- Matthieu Moy http://www-verimag.imag.fr/~moy/