From 4387ca78f0aada6ce04e4132e50f6b73fa60671f Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 25 Jan 2015 01:28:17 +0100 Subject: [PATCH] fs/hfs/hfs_open: Check that mount succeeded. Found by: Coverity scan. --- grub-core/fs/hfs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/grub-core/fs/hfs.c b/grub-core/fs/hfs.c index f46f77a94..ab472f4b0 100644 --- a/grub-core/fs/hfs.c +++ b/grub-core/fs/hfs.c @@ -1306,6 +1306,12 @@ grub_hfs_open (struct grub_file *file, const char *name) data = grub_hfs_mount (file->device->disk); + if (!data) + { + grub_dl_unref (my_mod); + return grub_errno; + } + if (grub_hfs_find_dir (data, name, &frec, 0)) { grub_free (data);