diff options
-rw-r--r-- | source3/locking/locking.c | 4 |
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; } |