From 12ea6a4c1b50d4ef00f9911dccd377b0f474ea0e Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:16:19 -0700 Subject: Stop leaking the host on an embedded page --- source/ui-shared.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/ui-shared.c b/source/ui-shared.c index 2760f64..506cfe2 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -1501,7 +1501,7 @@ void cgit_print_docstart(void) { const struct object_id *pinned; struct string_list_item *item; - char *host = cgit_hosturl(); + char *host; if (ctx.cfg.embedded) { if (ctx.cfg.header) @@ -1564,7 +1564,7 @@ void cgit_print_docstart(void) html_attr(ctx.cfg.favicon); html("'>\n"); } - if (host && ctx.repo && ctx.qry.head) { + if (ctx.repo && ctx.qry.head && (host = cgit_hosturl())) { html("\n"); + free(host); } if (ctx.repo) cgit_add_clone_urls(print_rel_vcs_link); @@ -1583,7 +1584,6 @@ void cgit_print_docstart(void) html("\n"); if (ctx.cfg.header) html_include(ctx.cfg.header); - free(host); } void cgit_print_docend(void) -- cgit 2.11.1