Date: Wed, 23 Nov 2011 10:27:19 +0000 (UTC) From: Kevin Lo <kevlo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r227876 - in head/usr.sbin: acpi/acpidb bluetooth/bt3cfw boot0cfg Message-ID: <201111231027.pANARJMH038660@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevlo Date: Wed Nov 23 10:27:18 2011 New Revision: 227876 URL: http://svn.freebsd.org/changeset/base/227876 Log: Plug fd leaks Modified: head/usr.sbin/acpi/acpidb/acpidb.c head/usr.sbin/bluetooth/bt3cfw/bt3cfw.c head/usr.sbin/boot0cfg/boot0cfg.c Modified: head/usr.sbin/acpi/acpidb/acpidb.c ============================================================================== --- head/usr.sbin/acpi/acpidb/acpidb.c Wed Nov 23 09:45:48 2011 (r227875) +++ head/usr.sbin/acpi/acpidb/acpidb.c Wed Nov 23 10:27:18 2011 (r227876) @@ -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); Modified: head/usr.sbin/bluetooth/bt3cfw/bt3cfw.c ============================================================================== --- head/usr.sbin/bluetooth/bt3cfw/bt3cfw.c Wed Nov 23 09:45:48 2011 (r227875) +++ head/usr.sbin/bluetooth/bt3cfw/bt3cfw.c Wed Nov 23 10:27:18 2011 (r227876) @@ -221,6 +221,7 @@ main(int argc, char *argv[]) free(firmware); firmware = NULL; + fclose(firmware_file); return (0); } Modified: head/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.c Wed Nov 23 09:45:48 2011 (r227875) +++ head/usr.sbin/boot0cfg/boot0cfg.c Wed Nov 23 10:27:18 2011 (r227876) @@ -330,10 +330,12 @@ read_mbr(const char *disk, u_int8_t **mb 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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111231027.pANARJMH038660>