From: Christian Hesse Date: Fri, 9 Oct 2015 12:55:50 +0000 (+0200) Subject: ui-plain: fix resource leak: free before assigning NULL X-Git-Tag: v0.12~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=08a2b818f2bd3221a1685c28c62408d57b0993a7;p=cgit ui-plain: fix resource leak: free before assigning NULL Coverity-id: 13939 Signed-off-by: Christian Hesse --- diff --git a/ui-plain.c b/ui-plain.c index 4c73607..e4beb99 100644 --- a/ui-plain.c +++ b/ui-plain.c @@ -84,8 +84,10 @@ static void print_dir(const unsigned char *sha1, const char *base, slash = strrchr(fullpath, '/'); if (slash) *(slash + 1) = 0; - else + else { + free(fullpath); fullpath = NULL; + } html("
  • "); cgit_plain_link("../", NULL, NULL, ctx.qry.head, ctx.qry.sha1, fullpath);