mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
Use TALLOC_ZERO_P instead of separate ZERO_STRUCTP in dup_nt_token
This commit is contained in:
@ -38,14 +38,12 @@ NT_USER_TOKEN *dup_nt_token(TALLOC_CTX *mem_ctx, const NT_USER_TOKEN *ptoken)
|
||||
if (!ptoken)
|
||||
return NULL;
|
||||
|
||||
token = TALLOC_P(mem_ctx, NT_USER_TOKEN);
|
||||
token = TALLOC_ZERO_P(mem_ctx, NT_USER_TOKEN);
|
||||
if (token == NULL) {
|
||||
DEBUG(0, ("talloc failed\n"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ZERO_STRUCTP(token);
|
||||
|
||||
if (ptoken->user_sids && ptoken->num_sids) {
|
||||
token->user_sids = (DOM_SID *)talloc_memdup(
|
||||
token, ptoken->user_sids, sizeof(DOM_SID) * ptoken->num_sids );
|
||||
|
Reference in New Issue
Block a user