Browse Source

lguest: Don't leak /dev/zero fd

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Mark McLoughlin 17 years ago
parent
commit
34bdaab44d
1 changed files with 1 additions and 0 deletions
  1. 1 0
      Documentation/lguest/lguest.c

+ 1 - 0
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;
 }