diff --git a/ChangeLog b/ChangeLog index 7e932d412..1d76f8461 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-05-27 Vladimir Serbinenko + + * grub-core/kern/emu/hostdisk.c (open_device): Set dest->dev to 0 after + freeing. + 2012-05-27 Vladimir Serbinenko * util/grub-mkconfig_lib.in (print_option_help): Properly redirect diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c index 89dcd1daa..772df26ee 100644 --- a/grub-core/kern/emu/hostdisk.c +++ b/grub-core/kern/emu/hostdisk.c @@ -861,6 +861,7 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags, else { free (data->dev); + data->dev = 0; if (data->fd != -1) { if (data->access_mode == O_RDWR || data->access_mode == O_WRONLY) @@ -941,6 +942,7 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags, else { free (data->dev); + data->dev = 0; if (data->fd != -1) { if (data->access_mode == O_RDWR || data->access_mode == O_WRONLY)