mirror of
https://git.zx2c4.com/cgit
synced 2024-11-23 00:48:42 +00:00
ui-plain: fix resource leak: free before assigning NULL
Coverity-id: 13939 Signed-off-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
parent
979db79a80
commit
08a2b818f2
@ -84,8 +84,10 @@ static void print_dir(const unsigned char *sha1, const char *base,
|
|||||||
slash = strrchr(fullpath, '/');
|
slash = strrchr(fullpath, '/');
|
||||||
if (slash)
|
if (slash)
|
||||||
*(slash + 1) = 0;
|
*(slash + 1) = 0;
|
||||||
else
|
else {
|
||||||
|
free(fullpath);
|
||||||
fullpath = NULL;
|
fullpath = NULL;
|
||||||
|
}
|
||||||
html("<li>");
|
html("<li>");
|
||||||
cgit_plain_link("../", NULL, NULL, ctx.qry.head, ctx.qry.sha1,
|
cgit_plain_link("../", NULL, NULL, ctx.qry.head, ctx.qry.sha1,
|
||||||
fullpath);
|
fullpath);
|
||||||
|
Loading…
Reference in New Issue
Block a user