Files
git/builtin
Ævar Arnfjörð Bjarmason 4e83605d38 submodule--helper: fix obscure leak in module_add()
Fix an obscure leak in module_add(), if the "git add" command we were
piping to failed we'd fail to strbuf_release(&sb). This fixes a leak
introduced in a6226fd772 (submodule--helper: convert the bulk of
cmd_add() to C, 2021-08-10).

In fixing it move to a "goto cleanup" pattern, and since we need to
introduce a "ret" variable to do that let's also get rid of the
intermediate "exit_code" variable. The initialization to "-1" in
a6226fd772 has always been redundant, we'd only use the "exit_code"
value after assigning the return value of pipe_command() to it.

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>
2022-09-02 09:18:13 -07:00
..
2022-06-07 14:10:56 -07:00
2022-04-06 09:42:14 -07:00
2022-02-17 16:25:05 -08:00
2021-10-28 09:57:09 -07:00
2022-04-04 10:56:23 -07:00
2022-07-18 13:31:57 -07:00
2022-07-01 11:43:43 -07:00
2022-03-09 13:38:24 -08:00
2022-06-07 14:10:56 -07:00
2022-04-06 15:21:59 -07:00
2021-04-14 13:47:21 -07:00
2022-07-18 13:31:53 -07:00
2022-06-10 15:04:15 -07:00
2022-01-10 11:52:56 -08:00
2022-06-10 15:04:13 -07:00
2021-11-03 13:25:36 -07:00