mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 14:59:34 +00:00
zfsinfo: Correct a check for error allocating memory
While arguably the check for grub_errno is correct, we should really be checking the return value from the function since it is always possible that grub_errno was set elsewhere, making this code behave incorrectly. Fixes: CID 73668 Signed-off-by: Darren Kenny <darren.kenny@oracle.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
1 parent
302c12ff57
commit
7aab03418e
1 file changed
+2
-2
@@ -358,8 +358,8 @@ grub_cmd_zfs_bootfs (grub_command_t cmd __attribute__ ((unused)), int argc,
|
|||||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||||
|
|
||||||
devname = grub_file_get_device_name (args[0]);
|
devname = grub_file_get_device_name (args[0]);
|
||||||
if (grub_errno)
|
if (devname == NULL)
|
||||||
return grub_errno;
|
return GRUB_ERR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
dev = grub_device_open (devname);
|
dev = grub_device_open (devname);
|
||||||
grub_free (devname);
|
grub_free (devname);
|
||||||
|
|||||||
Reference in new issue
Block a user