Re: [PATCH v2 04/24] submodule--helper: fix most "struct pathspec" memory leaks
- From
Glen Choo <chooglen@google.com>
- Date
- Jul 21, 2022, 17:49 UTC
- Message-ID
- <kl6ledyetkxp.fsf@chooglen-macbookpro.roam.corp.google.com>
- In-Reply-To
- <patch-v2-04.24-9fb60485c3e-20220719T204458Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 29 quoted lines
> Call clear_pathspec() at the end of various functions that work with > and allocate a "struct pathspec". > > Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> > --- > builtin/submodule--helper.c | 115 +++++++++++++++++++++++++----------- > 1 file changed, 81 insertions(+), 34 deletions(-) > > diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c > index b36919b66c5..28c5fdb8954 100644 > --- a/builtin/submodule--helper.c > +++ b/builtin/submodule--helper.c > @@ -1105,7 +1129,7 @@ static int compute_summary_module_list(struct object_id *head_oid, > struct strvec diff_args = STRVEC_INIT; > struct rev_info rev; > struct module_cb_list list = MODULE_CB_LIST_INIT; > - int ret = 0; > + int ret; > > strvec_push(&diff_args, get_diff_cmd(diff_cmd)); > if (info->cached) > @@ -1145,6 +1169,7 @@ static int compute_summary_module_list(struct object_id *head_oid, > else > run_diff_files(&rev, 0); > prepare_submodule_summary(info, &list); > + ret = 0; > cleanup: > strvec_clear(&diff_args); > release_revisions(&rev);
This function doesn't use a pathspec at all. Was it changed for consistency reasons or perhaps an accidental inclusion?
All the other hunks look correct.