From: Christian Hesse Date: Sat, 10 Oct 2015 14:56:26 +0000 (+0200) Subject: ui-atom: fix resource leak: free before return X-Git-Tag: v0.12~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=144e3c6085cfea95868a799ee976ed221dd86d8a;p=cgit ui-atom: fix resource leak: free before return Coverity-id: 13946 Signed-off-by: Christian Hesse --- diff --git a/ui-atom.c b/ui-atom.c index d7138fb..fab4b0f 100644 --- 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("\n"); + free(host); }