From: Ævar Arnfjörð Bjarmason Date: Wed, 31 Aug 2022 23:14:16 +0000 (+0200) Subject: submodule--helper: fix a leak with repo_clear() X-Git-Url: https://www.git.kevux.org/?a=commitdiff_plain;h=17af0a8444523f4df98e21165a3e476f05749237;p=rit submodule--helper: fix a leak with repo_clear() Call repo_clear() in ensure_core_worktree() to free the "struct repository". Fixes a leak that's been here since 74d4731da1f (submodule--helper: replace connect-gitdir-workingtree by ensure-core-worktree, 2018-08-13). Signed-off-by: Ævar Arnfjörð Bjarmason Reviewed-by: Glen Choo Signed-off-by: Junio C Hamano --- diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 3453faabd3..79ffcb5090 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -2397,6 +2397,7 @@ static int ensure_core_worktree(const char *path) strbuf_release(&sb); } + repo_clear(&subrepo); return 0; }