all repos — cgit @ 6edfc1672cdc5eb0dfb0ff5db0ec1de1ec53415e

a hyperfast web frontend for git written in c

ui-shared: fix resource leak: free allocation from cgit_hosturl

Signed-off-by: Christian Hesse <mail@eworm.de>
Christian Hesse mail@eworm.de
Fri, 09 Oct 2015 13:15:51 +0200
commit

6edfc1672cdc5eb0dfb0ff5db0ec1de1ec53415e

parent

f77e2a8cfaf07b25ddedd57348a1d957b048bbf5

1 files changed, 3 insertions(+), 2 deletions(-)

jump to
M ui-shared.cui-shared.c

@@ -730,7 +730,7 @@ html_include(ctx.cfg.header);

return; } - const char *host = cgit_hosturl(); + char *host = cgit_hosturl(); html(cgit_doctype); html("<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>\n"); html("<head>\n");

@@ -755,7 +755,7 @@ strbuf_addf(&sb, "h=%s", ctx.qry.head);

html("<link rel='alternate' title='Atom feed' href='"); html(cgit_httpscheme()); - html_attr(cgit_hosturl()); + html_attr(host); fileurl = cgit_fileurl(ctx.repo->url, "atom", ctx.qry.vpath, sb.buf); html_attr(fileurl);

@@ -771,6 +771,7 @@ html("</head>\n");

html("<body>\n"); if (ctx.cfg.header) html_include(ctx.cfg.header); + free(host); } void cgit_print_docend(void)