summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-05-28 10:38:52 +0200
committerVolker Lendecke <vl@samba.org>2011-05-28 10:39:48 +0200
commit77ce431fdbd9f85f44c9bd8812e275a0b0e73f5d (patch)
treecde59655ef3fa89979a22f75629dda9ba9145128 /source3
parent4586f5176bab04f7e003a3e93e4d62a512e8c047 (diff)
downloadsamba-77ce431fdbd9f85f44c9bd8812e275a0b0e73f5d.tar.gz
samba-77ce431fdbd9f85f44c9bd8812e275a0b0e73f5d.tar.bz2
samba-77ce431fdbd9f85f44c9bd8812e275a0b0e73f5d.zip
s3: Use talloc_memdup in copy_unix_token
Diffstat (limited to 'source3')
-rw-r--r--source3/locking/locking.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index f3a8d8c3f5..3e511c487d 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -1493,11 +1493,11 @@ static struct security_unix_token *copy_unix_token(TALLOC_CTX *ctx, const struct
cpy->ngroups = tok->ngroups;
if (tok->ngroups) {
/* Make this a talloc child of cpy. */
- cpy->groups = TALLOC_ARRAY(cpy, gid_t, tok->ngroups);
+ cpy->groups = (gid_t *)talloc_memdup(
+ cpy, tok->groups, tok->ngroups * sizeof(gid_t));
if (!cpy->groups) {
return NULL;
}
- memcpy(cpy->groups, tok->groups, tok->ngroups * sizeof(gid_t));
}
return cpy;
}