mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-11 07:24:46 +00:00
fs/squashfs: Fix memory leak in sqfs_size_nest()
In case MAX_SYMLINK_NEST is reached while determining the size on a symlink node, the function returns immediately. This would not free the resources after the free_strings: label causing a memory leak. Set the ret value and just break out of the switch to fix this. Signed-off-by: Andrea della Porta <andrea.porta@suse.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
parent
31378bd6fc
commit
e22b2d7781
1 changed files with 2 additions and 1 deletions
|
@ -1712,7 +1712,8 @@ static int sqfs_size_nest(const char *filename, loff_t *size)
|
|||
case SQFS_LSYMLINK_TYPE:
|
||||
if (++symlinknest == MAX_SYMLINK_NEST) {
|
||||
*size = 0;
|
||||
return -ELOOP;
|
||||
ret = -ELOOP;
|
||||
break;
|
||||
}
|
||||
|
||||
symlink = (struct squashfs_symlink_inode *)ipos;
|
||||
|
|
Loading…
Add table
Reference in a new issue