]> err.no Git - linux-2.6/commitdiff
lguest: Don't leak /dev/zero fd
authorMark McLoughlin <markmc@redhat.com>
Fri, 13 Jun 2008 13:04:58 +0000 (14:04 +0100)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 28 Jul 2008 23:58:33 +0000 (09:58 +1000)
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Documentation/lguest/lguest.c

index 6ded39bfdbdb3319237337287135d7cf67af0552..686e2d435c7575a687f97e363be2eabb1ba33ccb 100644 (file)
@@ -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;
 }