chainloader: fix resoource leak
Found by: Coverity scan. CID: 96651
This commit is contained in:
parent
806bb7999d
commit
c058e85615
1 changed files with 3 additions and 3 deletions
|
@ -350,9 +350,6 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
|
|||
}
|
||||
loaded_image->device_handle = dev_handle;
|
||||
|
||||
grub_file_close (file);
|
||||
file = NULL;
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
int i, len;
|
||||
|
@ -382,6 +379,9 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
|
|||
loaded_image->load_options_size = len;
|
||||
}
|
||||
|
||||
grub_file_close (file);
|
||||
grub_device_close (dev);
|
||||
|
||||
grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0);
|
||||
return 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue