]> granicus.if.org Git - cgit/commitdiff
ui-atom: fix resource leak: free allocation from cgit_repourl
authorChristian Hesse <mail@eworm.de>
Sat, 10 Oct 2015 14:56:25 +0000 (16:56 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sat, 10 Oct 2015 19:39:53 +0000 (21:39 +0200)
Coverity-id: 13947
Signed-off-by: Christian Hesse <mail@eworm.de>
ui-atom.c

index e2b39ee1d1c51cb109e69dc65b26feefe866d76d..d7138fbbaee4c6769e58af8bbef345d081b77279 100644 (file)
--- a/ui-atom.c
+++ b/ui-atom.c
@@ -125,11 +125,13 @@ void cgit_print_atom(char *tip, char *path, int max_count)
        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);