From 77ce431fdbd9f85f44c9bd8812e275a0b0e73f5d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 28 May 2011 10:38:52 +0200 Subject: s3: Use talloc_memdup in copy_unix_token --- source3/locking/locking.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/locking') 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; } -- cgit