mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
fs/iso9660: Fix memory leaks in grub_iso9660_susp_iterate()
Fixes: 99373ce47 (* grub-core/fs/iso9660.c: Remove nested functions)
Signed-off-by: t.feng <fengtao40@huawei.com>
Reviewed-by: Thomas Schmitt <scdbackup@gmx.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
1 parent
a1e05167c8
commit
7338cbe91a
1 file changed
+8
-2
@@ -279,7 +279,10 @@ grub_iso9660_susp_iterate (grub_fshelp_node_t node, grub_off_t off,
|
|||||||
/* Load a part of the System Usage Area. */
|
/* Load a part of the System Usage Area. */
|
||||||
err = read_node (node, off, sua_size, sua);
|
err = read_node (node, off, sua_size, sua);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
{
|
||||||
|
grub_free (sua);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
for (entry = (struct grub_iso9660_susp_entry *) sua; (char *) entry < (char *) sua + sua_size - 1 && entry->len > 0;
|
for (entry = (struct grub_iso9660_susp_entry *) sua; (char *) entry < (char *) sua + sua_size - 1 && entry->len > 0;
|
||||||
entry = (struct grub_iso9660_susp_entry *)
|
entry = (struct grub_iso9660_susp_entry *)
|
||||||
@@ -309,7 +312,10 @@ grub_iso9660_susp_iterate (grub_fshelp_node_t node, grub_off_t off,
|
|||||||
err = grub_disk_read (node->data->disk, ce_block, off,
|
err = grub_disk_read (node->data->disk, ce_block, off,
|
||||||
sua_size, sua);
|
sua_size, sua);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
{
|
||||||
|
grub_free (sua);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
entry = (struct grub_iso9660_susp_entry *) sua;
|
entry = (struct grub_iso9660_susp_entry *) sua;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user