all repos — cgit @ 08a2b818f2bd3221a1685c28c62408d57b0993a7

a hyperfast web frontend for git written in c

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
commit

08a2b818f2bd3221a1685c28c62408d57b0993a7

parent

979db79a80f1926c677691b68eb22b4852a77b50

1 files changed, 3 insertions(+), 1 deletions(-)

jump to
M ui-plain.cui-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);