[PATCH v5 07/17] submodule--helper: fix "errmsg_str" memory leak
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Aug 2, 2022, 15:54 UTC
- Message-ID
- <patch-v5-07.17-1a85057cd0c-20220802T155002Z-avarab@gmail.com>
- In-Reply-To
- <cover-v5-00.17-00000000000-20220802T155002Z-avarab@gmail.com>
Fix a memory leak introduced in e83e3333b57 (submodule: port submodule subcommand 'summary' from shell to C, 2020-08-13), we sometimes append to the "errmsg", and need to free the "struct strbuf".
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- builtin/submodule--helper.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 8e9ef58f8be..68bf0f9178f 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -980,6 +980,7 @@ static void generate_submodule_summary(struct summary_cb *info, free(displaypath); free(src_abbrev); free(dst_abbrev); + strbuf_release(&errmsg); } static void prepare_submodule_summary(struct summary_cb *info,
-- 2.37.1.1233.ge8b09efaedc