1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-09 08:58:35 +03:00

s3: Use talloc_memdup in copy_unix_token

This commit is contained in:
Volker Lendecke 2011-05-28 10:38:52 +02:00
parent 4586f5176b
commit 77ce431fdb

View File

@ -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;
}