summaryrefslogtreecommitdiffstats
path: root/Documentation/lguest
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2008-06-13 14:04:58 +0100
committerRusty Russell <rusty@rustcorp.com.au>2008-07-29 09:58:33 +1000
commit34bdaab44dd5dac861b0d23bc29b147b569e5783 (patch)
tree15dfb12a794d9de9341a90af3a5f6358216eaec0 /Documentation/lguest
parent32c68e5c569fdf016b494ce2fc8eecf59b6881bd (diff)
downloadop-kernel-dev-34bdaab44dd5dac861b0d23bc29b147b569e5783.zip
op-kernel-dev-34bdaab44dd5dac861b0d23bc29b147b569e5783.tar.gz
lguest: Don't leak /dev/zero fd
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'Documentation/lguest')
-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 6ded39b..686e2d4 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;
}
OpenPOWER on IntegriCloud