git.samba.org
/
metze
/
samba
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6b2b125
)
s3-vfs: Don't leak file descriptor.
author
Andreas Schneider
<asn@samba.org>
Wed, 20 Feb 2013 08:16:25 +0000
(09:16 +0100)
committer
Alexander Bokovoy
<ab@samba.org>
Fri, 22 Feb 2013 15:36:13 +0000
(16:36 +0100)
Reviewed-by: Alexander Bokovoy <ab@samba.org>
source3/modules/vfs_aio_fork.c
patch
|
blob
|
history
diff --git
a/source3/modules/vfs_aio_fork.c
b/source3/modules/vfs_aio_fork.c
index 1d840fa42e4cae51cef592f271c6d6202885e742..dc33031d677eadd5bfcb61ed9c34324178e5f07a 100644
(file)
--- 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);