From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Riesen Date: Tue, 08 Jun 2004 09:21:54 +0000 Subject: Re: [ANNOUNCE] udev 026 release Message-Id: <20040608092154.GA28969@linux-ari.internal> List-Id: In-Reply-To: <20040607231440.GB11257@kroah.com> References: <20040607231440.GB11257@kroah.com> In-Reply-To: <20040607231440.GB11257@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Greg KH Cc: linux-kernel@vger.kernel.org, linux-hotplug-devel@lists.sourceforge.net There is a handle leak in failure path in file_map, and the result of file_map (or the result of the caller of the file_map) is not always checked. --- udev_lib.c 2004-06-08 11:08:35.812419586 +0200 +++ udev_lib.c 2004-06-08 11:10:53.203654065 +0200 @@ -124,11 +124,13 @@ int file_map(const char *filename, char } if (fstat(fd, &stats) < 0) { + close(fd); return -1; } *buf = mmap(NULL, stats.st_size, PROT_READ, MAP_SHARED, fd, 0); if (*buf = MAP_FAILED) { + close(fd); return -1; } *bufsize = stats.st_size; ------------------------------------------------------- This SF.Net email is sponsored by: GNOME Foundation Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event. GNOME Users and Developers European Conference, 28-30th June in Norway http://2004/guadec.org _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel