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
|
@ -397,7 +397,10 @@ grub_romfs_read (grub_file_t file, char *buf, grub_size_t len)
|
|||
static grub_err_t
|
||||
grub_romfs_close (grub_file_t file)
|
||||
{
|
||||
grub_free (file->data);
|
||||
struct grub_fshelp_node *data = file->data;
|
||||
|
||||
grub_free (data->data);
|
||||
grub_free (data);
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
@ -432,6 +435,7 @@ grub_romfs_label (grub_device_t device, char **label)
|
|||
return err;
|
||||
}
|
||||
(*label)[data->first_file - sizeof (struct grub_romfs_superblock)] = 0;
|
||||
grub_free (data);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue