summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-08-31 23:14:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-09-02 16:18:12 (GMT)
commit61adac6c4b5839ffcc8b0f7081acac4a18240644 (patch)
tree7108c76b81c25b384f7af5fcd354ee35796307d9
parent87a683482a3982751fdc9d4252035d0cafab605d (diff)
downloadgit-61adac6c4b5839ffcc8b0f7081acac4a18240644.zip
git-61adac6c4b5839ffcc8b0f7081acac4a18240644.tar.gz
git-61adac6c4b5839ffcc8b0f7081acac4a18240644.tar.bz2
submodule--helper: fix "errmsg_str" memory leak
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> Reviewed-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/submodule--helper.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 65cd25a..c95098e 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -973,6 +973,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,