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

index d7138fbbaee4c6769e58af8bbef345d081b77279..fab4b0fd8d50bbb83b2129227394e65f606f058a 100644 (file)
--- a/ui-atom.c
+++ b/ui-atom.c
@@ -80,7 +80,7 @@ static void add_entry(struct commit *commit, const char *host)
 
 void cgit_print_atom(char *tip, char *path, int max_count)
 {
-       const char *host;
+       char *host;
        const char *argv[] = {NULL, tip, NULL, NULL, NULL};
        struct commit *commit;
        struct rev_info rev;
@@ -140,4 +140,5 @@ void cgit_print_atom(char *tip, char *path, int max_count)
                commit->parents = NULL;
        }
        html("</feed>\n");
+       free(host);
 }