From 37fce9916a264e23c0639df56ca3ecbbdc1c84b8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 9 Oct 2015 13:15:46 +0200 Subject: [PATCH] ui-shared: fix resource leak: free allocation from cgit_fileurl Coverity-id: 13918 Signed-off-by: Christian Hesse --- ui-shared.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ui-shared.c b/ui-shared.c index 89c4897..d9f8258 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -746,16 +746,19 @@ void cgit_print_docstart(void) html("'/>\n"); } if (host && ctx.repo && ctx.qry.head) { + char *fileurl; struct strbuf sb = STRBUF_INIT; strbuf_addf(&sb, "h=%s", ctx.qry.head); html("\n"); strbuf_release(&sb); + free(fileurl); } if (ctx.repo) cgit_add_clone_urls(print_rel_vcs_link); @@ -997,9 +1000,12 @@ void cgit_print_pageheader(void) ctx.qry.head, ctx.qry.vpath); html(""); html("
\n"); cgit_add_hidden_formfields(1, 0, "log"); html("