Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2023-02-07 02:07:46 +0300
committerJunio C Hamano <gitster@pobox.com>2023-02-07 02:34:38 +0300
commit9d01cfed6915b1e99c266fd578e39c7aba7767dc (patch)
treeeee2c67e7a2cba12e0f9de22311ceef511097c4f /builtin/commit-graph.c
parent2139bd0200b2ee51674d8778cd26a9f38220a5b7 (diff)
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>
Diffstat (limited to 'builtin/commit-graph.c')
-rw-r--r--builtin/commit-graph.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
index 0102ac8540..93704f95a9 100644
--- a/builtin/commit-graph.c
+++ b/builtin/commit-graph.c
@@ -269,8 +269,8 @@ static int graph_write(int argc, const char **argv, const char *prefix)
if (opts.reachable) {
if (write_commit_graph_reachable(odb, flags, &write_opts))
- return 1;
- return 0;
+ result = 1;
+ goto cleanup;
}
if (opts.stdin_packs) {