summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2011-11-23 10:27:18 +0000
committerkevlo <kevlo@FreeBSD.org>2011-11-23 10:27:18 +0000
commit2fca8765a2f8f21d5d59ea3a791e5ca51fba50dc (patch)
tree0f2f3e671dd7714749793d35d1d678111be67f3b /usr.sbin
parent636924cae77a11f6f84663fada352e6c5ee88715 (diff)
downloadFreeBSD-src-2fca8765a2f8f21d5d59ea3a791e5ca51fba50dc.zip
FreeBSD-src-2fca8765a2f8f21d5d59ea3a791e5ca51fba50dc.tar.gz
Plug fd leaks
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/acpi/acpidb/acpidb.c1
-rw-r--r--usr.sbin/bluetooth/bt3cfw/bt3cfw.c1
-rw-r--r--usr.sbin/boot0cfg/boot0cfg.c2
3 files changed, 4 insertions, 0 deletions
diff --git a/usr.sbin/acpi/acpidb/acpidb.c b/usr.sbin/acpi/acpidb/acpidb.c
index 325dfae..2ffb696 100644
--- a/usr.sbin/acpi/acpidb/acpidb.c
+++ b/usr.sbin/acpi/acpidb/acpidb.c
@@ -370,6 +370,7 @@ load_dsdt(const char *dsdtfile)
}
if (fstat(fd, &sb) == -1) {
perror("fstat");
+ close(fd);
return (-1);
}
code = mmap(NULL, (size_t)sb.st_size, PROT_READ, MAP_PRIVATE, fd, (off_t)0);
diff --git a/usr.sbin/bluetooth/bt3cfw/bt3cfw.c b/usr.sbin/bluetooth/bt3cfw/bt3cfw.c
index aadb6b6..fcc8d1d 100644
--- a/usr.sbin/bluetooth/bt3cfw/bt3cfw.c
+++ b/usr.sbin/bluetooth/bt3cfw/bt3cfw.c
@@ -221,6 +221,7 @@ main(int argc, char *argv[])
free(firmware);
firmware = NULL;
+ fclose(firmware_file);
return (0);
}
diff --git a/usr.sbin/boot0cfg/boot0cfg.c b/usr.sbin/boot0cfg/boot0cfg.c
index 72baf46..935f85b 100644
--- a/usr.sbin/boot0cfg/boot0cfg.c
+++ b/usr.sbin/boot0cfg/boot0cfg.c
@@ -330,10 +330,12 @@ read_mbr(const char *disk, u_int8_t **mbr, int check_version)
err(1, "%s", disk);
if (n != mbr_size)
errx(1, "%s: short read", disk);
+ close(fd);
return (mbr_size);
}
*mbr = malloc(sizeof(buf));
memcpy(*mbr, buf, sizeof(buf));
+ close(fd);
return sizeof(buf);
}
OpenPOWER on IntegriCloud