From: Mark McLoughlin Date: Fri, 13 Jun 2008 13:04:58 +0000 (+0100) Subject: lguest: Don't leak /dev/zero fd X-Git-Tag: v2.6.27-rc1~1^2~11 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34bdaab44dd5dac861b0d23bc29b147b569e5783;p=linux-2.6 lguest: Don't leak /dev/zero fd Signed-off-by: Mark McLoughlin Signed-off-by: Rusty Russell --- diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index 6ded39bfdb..686e2d435c 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c @@ -254,6 +254,7 @@ static void *map_zeroed_pages(unsigned int num) PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, fd, 0); if (addr == MAP_FAILED) err(1, "Mmaping %u pages of /dev/zero", num); + close(fd); return addr; }