From 17af0a8444523f4df98e21165a3e476f05749237 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 1 Sep 2022 01:14:16 +0200 Subject: [PATCH] submodule--helper: fix a leak with repo_clear() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- builtin/submodule--helper.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.52.0