if (fd < 0 || fstat (fd, &st) < 0)
{
+ if (fd >= 0)
+ close (fd);
kill_trailing_dir(sysfs_path);
if (!strcmp(sysfs_path, "/sys"))
{
{
grub_util_info (_("cannot read `%s': %s"), path, strerror (errno));
close(fd);
+ free (path);
+ free (of_path);
+ free (sysfs_path);
return NULL;
}
close(fd);
snprintf(disk, sizeof (disk),
"/sas/%s@%lx,%lu:%c", disk_name, sas_address, longlun, 'a' + (part - 1));
}
+ free (lunstr);
}
}
strcat(of_path, disk);
else
{
grub_util_warn (_("unknown device type %s\n"), device);
- return NULL;
+ ofpath = NULL;
}
free (devnode);