mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
libcli/security Use talloc_zero when making a struct security_token
This commit is contained in:
parent
fdcadb5c3c
commit
a02a2c3557
@ -157,8 +157,6 @@ NTSTATUS security_token_create(TALLOC_CTX *mem_ctx,
|
|||||||
ptoken = security_token_initialise(mem_ctx);
|
ptoken = security_token_initialise(mem_ctx);
|
||||||
NT_STATUS_HAVE_NO_MEMORY(ptoken);
|
NT_STATUS_HAVE_NO_MEMORY(ptoken);
|
||||||
|
|
||||||
ptoken->privilege_mask = 0;
|
|
||||||
|
|
||||||
ptoken->sids = talloc_array(ptoken, struct dom_sid, n_groupSIDs + 6 /* over-allocate */);
|
ptoken->sids = talloc_array(ptoken, struct dom_sid, n_groupSIDs + 6 /* over-allocate */);
|
||||||
NT_STATUS_HAVE_NO_MEMORY(ptoken->sids);
|
NT_STATUS_HAVE_NO_MEMORY(ptoken->sids);
|
||||||
|
|
||||||
|
@ -31,15 +31,11 @@ struct security_token *security_token_initialise(TALLOC_CTX *mem_ctx)
|
|||||||
{
|
{
|
||||||
struct security_token *st;
|
struct security_token *st;
|
||||||
|
|
||||||
st = talloc(mem_ctx, struct security_token);
|
st = talloc_zero(mem_ctx, struct security_token);
|
||||||
if (!st) {
|
if (!st) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
st->num_sids = 0;
|
|
||||||
st->sids = NULL;
|
|
||||||
st->privilege_mask = 0;
|
|
||||||
|
|
||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user