Fix fd leak in libdisk's Disk_Names()
This commit is contained in:
parent
d3a1fb7278
commit
a4af1d9ca0
@ -400,9 +400,13 @@ Disk_Names()
|
||||
if ((fd = open(disk, O_RDWR)) == -1)
|
||||
continue;
|
||||
if (ioctl(fd, DIOCGSLICEINFO, &ds) == -1) {
|
||||
#ifdef DEBUG
|
||||
warn("DIOCGSLICEINFO %s", disk);
|
||||
#endif
|
||||
close(fd);
|
||||
continue;
|
||||
}
|
||||
close(fd);
|
||||
disks[k++] = strdup(diskname);
|
||||
if(k == MAX_NO_DISKS)
|
||||
return disks;
|
||||
|
Loading…
Reference in New Issue
Block a user