From: Ævar Arnfjörð Bjarmason Date: Thu, 21 Oct 2021 15:57:35 GMT Subject: [PATCH 4/6] submodule--helper: fix small memory leaks Message-ID: In-Reply-To: Add a missing strbuf_release() and a clear_pathspec() to the submodule--helper. Signed-off-by: Ævar Arnfjörð Bjarmason --- builtin/submodule--helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 6298cbdd4e5..a157656a48a 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -3220,6 +3220,7 @@ static void die_on_index_match(const char *path, int force) } free(ps_matched); } + clear_pathspec(&ps); } static void die_on_repo_without_commits(const char *path) @@ -3231,6 +3232,7 @@ static void die_on_repo_without_commits(const char *path) if (resolve_gitlink_ref(path, "HEAD", &oid) < 0) die(_("'%s' does not have a commit checked out"), path); } + strbuf_release(&sb); } static int module_add(int argc, const char **argv, const char *prefix) -- 2.33.1.1494.g88b39a443e1