[PATCH v6 09/17] submodule--helper: fix a leak with repo_clear()
From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2022-08-21 14:02:39
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2022-08-21 14:02:39
Subsystem:
the rest · Maintainer:
Linus Torvalds
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 <redacted> --- builtin/submodule--helper.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index ea925178946..b029e109b47 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c@@ -2399,6 +2399,7 @@ static int ensure_core_worktree(const char *path) strbuf_release(&sb); } + repo_clear(&subrepo); return 0; }
--
2.37.2.1279.g64dec4e13cf