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);