Diff options
Diffstat (limited to 'source/ui-shared.c')
-rw-r--r--source/ui-shared.c6
1 file changed, 3 insertions, 3 deletions
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("<link rel='alternate' title='Atom feed' href='");
html(cgit_httpscheme());
html_attr(host);
@@ -1572,6 +1572,7 @@ void cgit_print_docstart(void)
html("h=");
html_url_arg(ctx.qry.head);
html("' type='application/atom+xml'>\n");
+ free(host);
}
if (ctx.repo)
cgit_add_clone_urls(print_rel_vcs_link);
@@ -1583,7 +1584,6 @@ void cgit_print_docstart(void)
html("<body>\n");
if (ctx.cfg.header)
html_include(ctx.cfg.header);
- free(host);
}
void cgit_print_docend(void)