diff options
| author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-09-01 01:14:16 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-09-02 09:18:13 -0700 |
| commit | 17af0a8444523f4df98e21165a3e476f05749237 (patch) | |
| tree | 2fab4926029fae8f27974f7867994fc83e4cad8e /builtin/submodule--helper.c | |
| parent | 980416e469ad2ed0d38630cf4c25390ae9731416 (diff) | |
| download | git-17af0a8444523f4df98e21165a3e476f05749237.tar.gz | |
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 <avarab@gmail.com>
Reviewed-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/submodule--helper.c')
| -rw-r--r-- | builtin/submodule--helper.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; } |
