diff options
author | imp <imp@FreeBSD.org> | 2000-03-10 22:54:04 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2000-03-10 22:54:04 +0000 |
commit | a4af1d9ca071ef70e600f2558af8691975ecdee9 (patch) | |
tree | db3b77267e4a7ac41e4a7040271ca3cddf900068 /lib/libdisk | |
parent | d3a1fb72786afe772d004a4220a0251de978f7f8 (diff) | |
download | FreeBSD-src-a4af1d9ca071ef70e600f2558af8691975ecdee9.zip FreeBSD-src-a4af1d9ca071ef70e600f2558af8691975ecdee9.tar.gz |
Fix fd leak in libdisk's Disk_Names()
Diffstat (limited to 'lib/libdisk')
-rw-r--r-- | lib/libdisk/disk.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libdisk/disk.c b/lib/libdisk/disk.c index 1cf23d1..0263149 100644 --- a/lib/libdisk/disk.c +++ b/lib/libdisk/disk.c @@ -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; |