summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2013-02-20 09:16:25 +0100
committerAlexander Bokovoy <ab@samba.org>2013-02-22 16:36:13 +0100
commitaab2e176dc8f67424cf8b4475a8bd38c79ad999a (patch)
tree0c04a25dc2dcdfb97acfb5046330e208afafd0ac
parent6b2b125ab910530610b5e3e4b72f6733bd1f174f (diff)
downloadsamba-aab2e176dc8f67424cf8b4475a8bd38c79ad999a.tar.gz
samba-aab2e176dc8f67424cf8b4475a8bd38c79ad999a.tar.bz2
samba-aab2e176dc8f67424cf8b4475a8bd38c79ad999a.zip
s3-vfs: Don't leak file descriptor.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
-rw-r--r--source3/modules/vfs_aio_fork.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c
index 1d840fa42e..dc33031d67 100644
--- a/source3/modules/vfs_aio_fork.c
+++ b/source3/modules/vfs_aio_fork.c
@@ -68,13 +68,12 @@ static struct mmap_area *mmap_area_init(TALLOC_CTX *mem_ctx, size_t size)
result->ptr = mmap(NULL, size, PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_FILE, fd, 0);
+ close(fd);
if (result->ptr == MAP_FAILED) {
DEBUG(1, ("mmap failed: %s\n", strerror(errno)));
goto fail;
}
- close(fd);
-
result->size = size;
talloc_set_destructor(result, mmap_area_destructor);