Fix several memory leaks.
* grub-core/fs/btrfs.c (grub_btrfs_dir): Fix memory leak. * grub-core/fs/cpio.c (grub_cpio_find_file): Likewise. (grub_cpio_dir): Likewise. * grub-core/fs/fat.c (grub_fat_label): Likewise. * grub-core/fs/jfs.c (grub_jfs_label): Likewise. * grub-core/fs/romfs.c (grub_romfs_close): Likewise. (grub_romfs_label): Likewise. * grub-core/fs/squash4.c (squash_mount): Use zalloc for safety. (squash_unmount): New function. (grub_squash_dir): Fix memory leak. (grub_squash_open): Likewise. (grub_squash_read): Likewise. (grub_squash_mtime): Likewise. * grub-core/fs/xfs.c (grub_xfs_open): Likewise. * grub-core/fs/zfs/zfs.c (check_pool_label): Likewise. * util/grub-fstest.c (fstest): Likewise.
This commit is contained in:
parent
57b0125004
commit
8a5a3a5b5a
10 changed files with 84 additions and 22 deletions
|
@ -771,10 +771,13 @@ grub_xfs_open (struct grub_file *file, const char *name)
|
|||
}
|
||||
|
||||
if (fdiro != &data->diropen)
|
||||
grub_memcpy (&data->diropen, fdiro,
|
||||
sizeof (struct grub_fshelp_node)
|
||||
- sizeof (struct grub_xfs_inode)
|
||||
+ (1 << data->sblock.log2_inode));
|
||||
{
|
||||
grub_memcpy (&data->diropen, fdiro,
|
||||
sizeof (struct grub_fshelp_node)
|
||||
- sizeof (struct grub_xfs_inode)
|
||||
+ (1 << data->sblock.log2_inode));
|
||||
grub_free (fdiro);
|
||||
}
|
||||
|
||||
file->size = grub_be_to_cpu64 (data->diropen.inode.size);
|
||||
file->data = data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue