]> git.ipfire.org Git - thirdparty/git.git/commit
commit-graph: fix a parse_options_concat() leak
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 6 Feb 2023 23:07:46 +0000 (00:07 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Feb 2023 23:34:38 +0000 (15:34 -0800)
commit9d01cfed6915b1e99c266fd578e39c7aba7767dc
treeeee2c67e7a2cba12e0f9de22311ceef511097c4f
parent2139bd0200b2ee51674d8778cd26a9f38220a5b7
commit-graph: fix a parse_options_concat() leak

When the parse_options_concat() was added to this file in
84e4484f128 (commit-graph: use parse_options_concat(), 2021-08-23) we
wouldn't free() it if we returned early in these cases.

Since "result" is 0 by default we can "goto cleanup" in both cases,
and only need to set "result" if write_commit_graph_reachable() fails.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit-graph.c