libcli/security Use talloc_zero when making a struct security_token
authorAndrew Bartlett <abartlet@samba.org>
Sat, 11 Sep 2010 07:00:10 +0000 (17:00 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 11 Sep 2010 08:46:14 +0000 (18:46 +1000)
source4/dsdb/samdb/samdb.c
source4/libcli/security/security_token.c

index ddcd0d2d125e23e139041ce4a2d3b86014296ee1..32698ea412b35da85e12a4e6a09de286fc22e5e3 100644 (file)
@@ -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);
 
index 42f157aac67ee66566a831f9522bf62c234af36f..9d37475c7a5cca1644889c07bab94523fa0b6db0 100644 (file)
@@ -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;
 }