Re: [ANNOUNCE] udev 026 release

From: Alex Riesen
Date: Tue Jun 08 2004 - 04:24:59 EST


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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/