From a02a2c3557928e507d1220303d9a3f79e8c46bb1 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 11 Sep 2010 17:00:10 +1000 Subject: libcli/security Use talloc_zero when making a struct security_token --- source4/dsdb/samdb/samdb.c | 2 -- source4/libcli/security/security_token.c | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c index ddcd0d2d12..32698ea412 100644 --- a/source4/dsdb/samdb/samdb.c +++ b/source4/dsdb/samdb/samdb.c @@ -157,8 +157,6 @@ NTSTATUS security_token_create(TALLOC_CTX *mem_ctx, ptoken = security_token_initialise(mem_ctx); NT_STATUS_HAVE_NO_MEMORY(ptoken); - ptoken->privilege_mask = 0; - ptoken->sids = talloc_array(ptoken, struct dom_sid, n_groupSIDs + 6 /* over-allocate */); NT_STATUS_HAVE_NO_MEMORY(ptoken->sids); diff --git a/source4/libcli/security/security_token.c b/source4/libcli/security/security_token.c index 42f157aac6..9d37475c7a 100644 --- a/source4/libcli/security/security_token.c +++ b/source4/libcli/security/security_token.c @@ -31,15 +31,11 @@ struct security_token *security_token_initialise(TALLOC_CTX *mem_ctx) { struct security_token *st; - st = talloc(mem_ctx, struct security_token); + st = talloc_zero(mem_ctx, struct security_token); if (!st) { return NULL; } - st->num_sids = 0; - st->sids = NULL; - st->privilege_mask = 0; - return st; } -- cgit