all repos — cgit @ 97da17b783697b4c5430f130ab449121d0692530

a hyperfast web frontend for git written in c

ui-atom: fix resource leak: free allocation from cgit_repourl

Coverity-id: 13947
Signed-off-by: Christian Hesse <mail@eworm.de>
Christian Hesse mail@eworm.de
Sat, 10 Oct 2015 16:56:25 +0200
commit

97da17b783697b4c5430f130ab449121d0692530

parent

7320bfa893bdb8ff873c3827c3dac1ce0d4034ea

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

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

@@ -125,11 +125,13 @@ html("<subtitle>");

html_txt(ctx.repo->desc); html("</subtitle>\n"); if (host) { + char *repourl = cgit_repourl(ctx.repo->url); html("<link rel='alternate' type='text/html' href='"); html(cgit_httpscheme()); html_attr(host); - html_attr(cgit_repourl(ctx.repo->url)); + html_attr(repourl); html("'/>\n"); + free(repourl); } while ((commit = get_revision(&rev)) != NULL) { add_entry(commit, host);