summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2008-06-13 15:04:58 +0200
committerRusty Russell <rusty@rustcorp.com.au>2008-07-29 01:58:33 +0200
commit34bdaab44dd5dac861b0d23bc29b147b569e5783 (patch)
tree15dfb12a794d9de9341a90af3a5f6358216eaec0
parentlguest: fix verbose printing of device features. (diff)
downloadlinux-34bdaab44dd5dac861b0d23bc29b147b569e5783.tar.xz
linux-34bdaab44dd5dac861b0d23bc29b147b569e5783.zip
lguest: Don't leak /dev/zero fd
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r--Documentation/lguest/lguest.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c
index 6ded39bfdbdb..686e2d435c75 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;
}