Thread (162 messages) 162 messages, 2 authors, 2022-09-01
STALE1365d
Revisions (6)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 [diff vs current]
  4. v5 current
  5. v6 [diff vs current]
  6. v7 [diff vs current]

[PATCH v5 09/17] submodule--helper: fix a leak with repo_clear()

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2022-08-02 15:55:13
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 f332627d19e..4e964a2c29c 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -2396,6 +2396,7 @@ static int ensure_core_worktree(const char *path)
 		strbuf_release(&sb);
 	}
 
+	repo_clear(&subrepo);
 	return 0;
 }
 
-- 
2.37.1.1233.ge8b09efaedc
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help