From 1e4ce4cdf86990d21197ca354a01d68f310db9a0 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:27:14 -0700 Subject: Pass request strings on without copying them --- source/ui-commit.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'source/ui-commit.c') diff --git a/source/ui-commit.c b/source/ui-commit.c index 63f2b7e..ce00cf0 100644 --- a/source/ui-commit.c +++ b/source/ui-commit.c @@ -247,7 +247,6 @@ void cgit_print_commit(char *hex, const char *prefix) struct object_id oid, first_oid; const char *commit_hex; char *first_parent; - char *tree_rev; int parents; if (!hex) @@ -293,13 +292,11 @@ void cgit_print_commit(char *hex, const char *prefix) parents = print_parent_rows(commit, hex, prefix, &first_oid); html("tree
"); - tree_rev = xstrdup(hex); - cgit_tree_link(oid_to_hex(get_commit_tree_oid(commit)), NULL, NULL, ctx.qry.head, tree_rev, NULL); + cgit_tree_link(oid_to_hex(get_commit_tree_oid(commit)), NULL, NULL, ctx.qry.head, hex, NULL); if (prefix) { html(" /"); - cgit_tree_link(prefix, NULL, NULL, ctx.qry.head, tree_rev, prefix); + cgit_tree_link(prefix, NULL, NULL, ctx.qry.head, hex, prefix); } - free(tree_rev); html("
\n"); if (ctx.repo->snapshots) { -- cgit 2.11.1