Skip to content

Commit 61adac6

Browse files
avargitster
authored andcommitted
submodule--helper: fix "errmsg_str" memory leak
Fix a memory leak introduced in e83e333 (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 <[email protected]> Reviewed-by: Glen Choo <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 87a6834 commit 61adac6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin/submodule--helper.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,7 @@ static void generate_submodule_summary(struct summary_cb *info,
973973
free(displaypath);
974974
free(src_abbrev);
975975
free(dst_abbrev);
976+
strbuf_release(&errmsg);
976977
}
977978

978979
static void prepare_submodule_summary(struct summary_cb *info,

0 commit comments

Comments
 (0)