git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4586f51
)
s3: Use talloc_memdup in copy_unix_token
author
Volker Lendecke
<vl@samba.org>
Sat, 28 May 2011 08:38:52 +0000
(10:38 +0200)
committer
Volker Lendecke
<vl@samba.org>
Sat, 28 May 2011 08:39:48 +0000
(10:39 +0200)
source3/locking/locking.c
patch
|
blob
|
history
diff --git
a/source3/locking/locking.c
b/source3/locking/locking.c
index f3a8d8c3f5c342372f24dd909d50f12c6c6bddc4..3e511c487d4fad143b1b12802f5dadc241760d43 100644
(file)
--- 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;
}