ui-plain: fix resource leak: free before assigning NULL Coverity-id: 13939 Signed-off-by: Christian Hesse <mail@eworm.de>
Christian Hesse mail@eworm.de
Fri, 09 Oct 2015 14:55:50 +0200
1 files changed,
3 insertions(+),
1 deletions(-)
jump to
M
ui-plain.c
→
ui-plain.c
@@ -84,8 +84,10 @@ fullpath[len - 1] = 0;
slash = strrchr(fullpath, '/'); if (slash) *(slash + 1) = 0; - else + else { + free(fullpath); fullpath = NULL; + } html("<li>"); cgit_plain_link("../", NULL, NULL, ctx.qry.head, ctx.qry.sha1, fullpath);