mirror of
https://git.proxmox.com/git/grub2
synced 2025-07-15 23:15:58 +00:00
commands/probe: Fix a resource leak when probing disks
Every other return statement in this code is calling grub_device_close() to clean up dev before returning. This one should do that too. Fixes: CID 292443 Signed-off-by: Darren Kenny <darren.kenny@oracle.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
8b6f528e52
commit
1fc860bb76
@ -111,7 +111,11 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
grub_disk_t disk = grub_disk_open(dev->disk->name);
|
||||
|
||||
if (!disk)
|
||||
return grub_errno;
|
||||
{
|
||||
grub_device_close (dev);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
if (grub_strcmp(dev->disk->partition->partmap->name, "gpt") == 0)
|
||||
{
|
||||
struct grub_gpt_partentry entry;
|
||||
|
Loading…
Reference in New Issue
Block a user