+2007-04-18 Theodore Tso <tytso@mit.edu>
+
+ * getsize.c (ext2fs_get_device_size): Make sure we don't leak a
+ file descriptor in some error cases.
+
2007-04-14 Theodore Tso <tytso@mit.edu>
* swapfs.c (ext2fs_swap_inode_full): Fix a problem byte-swapping
#ifdef DKIOCGETBLOCKCOUNT /* For Apple Darwin */
if (ioctl(fd, DKIOCGETBLOCKCOUNT, &size64) >= 0) {
if ((sizeof(*retblocks) < sizeof(unsigned long long))
- && ((size64 / (blocksize / 512)) > 0xFFFFFFFF))
- return EFBIG;
+ && ((size64 / (blocksize / 512)) > 0xFFFFFFFF)) {
+ rc = EFBIG;
+ goto out;
+ }
*retblocks = size64 / (blocksize / 512);
goto out;
}
valid_offset (fd, 0);
size64 = low + 1;
if ((sizeof(*retblocks) < sizeof(unsigned long long))
- && ((size64 / blocksize) > 0xFFFFFFFF))
- return EFBIG;
+ && ((size64 / blocksize) > 0xFFFFFFFF)) {
+ rc = EFBIG;
+ goto out;
+ }
*retblocks = size64 / blocksize;
out:
close(fd);