diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-07 11:44:43 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-09 12:40:08 +0200 |
commit | ad0a07c531fadd1639c5298951cfaf5cfe0cb10e (patch) | |
tree | a00938a8289ff4e9747622f1d46fa3607c7c50eb /source3/registry | |
parent | d5e6a47f064a3923b1e257ab84fa7ccd7c4f89f4 (diff) | |
download | samba-ad0a07c531fadd1639c5298951cfaf5cfe0cb10e.tar.gz samba-ad0a07c531fadd1639c5298951cfaf5cfe0cb10e.tar.xz samba-ad0a07c531fadd1639c5298951cfaf5cfe0cb10e.zip |
s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_P isn't standard talloc.
Diffstat (limited to 'source3/registry')
-rw-r--r-- | source3/registry/reg_api.c | 4 | ||||
-rw-r--r-- | source3/registry/reg_objects.c | 2 | ||||
-rw-r--r-- | source3/registry/reg_util_token.c | 2 | ||||
-rw-r--r-- | source3/registry/regfio.c | 14 |
4 files changed, 11 insertions, 11 deletions
diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index 150a3ab02d..51bd98e939 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -142,9 +142,9 @@ static WERROR regkey_open_onelevel(TALLOC_CTX *mem_ctx, SMB_ASSERT(strchr(name, '\\') == NULL); - if (!(regkey = TALLOC_ZERO_P(mem_ctx, struct registry_key)) || + if (!(regkey = talloc_zero(mem_ctx, struct registry_key)) || !(regkey->token = dup_nt_token(regkey, token)) || - !(regkey->key = TALLOC_ZERO_P(regkey, struct registry_key_handle))) + !(regkey->key = talloc_zero(regkey, struct registry_key_handle))) { result = WERR_NOMEM; goto done; diff --git a/source3/registry/reg_objects.c b/source3/registry/reg_objects.c index a2ae178783..54b6fe3441 100644 --- a/source3/registry/reg_objects.c +++ b/source3/registry/reg_objects.c @@ -62,7 +62,7 @@ struct regsubkey_ctr { context for internal private data. There is no longer a regval_ctr_intit() and regval_ctr_destroy() - pair of functions. Simply TALLOC_ZERO_P() and TALLOC_FREE() the + pair of functions. Simply talloc_zero() and TALLOC_FREE() the object. **********************************************************************/ diff --git a/source3/registry/reg_util_token.c b/source3/registry/reg_util_token.c index ca0159a649..d599b3a33d 100644 --- a/source3/registry/reg_util_token.c +++ b/source3/registry/reg_util_token.c @@ -38,7 +38,7 @@ NTSTATUS registry_create_admin_token(TALLOC_CTX *mem_ctx, return NT_STATUS_INVALID_PARAMETER; } - token = TALLOC_ZERO_P(mem_ctx, struct security_token); + token = talloc_zero(mem_ctx, struct security_token); if (token == NULL) { DEBUG(1, ("talloc failed\n")); status = NT_STATUS_NO_MEMORY; diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c index 925ff8775a..c1d40166cc 100644 --- a/source3/registry/regfio.c +++ b/source3/registry/regfio.c @@ -498,7 +498,7 @@ static REGF_HBIN* read_hbin_block( REGF_FILE *file, off_t offset ) REGF_HBIN *hbin; uint32 record_size, curr_off, block_size, header; - if ( !(hbin = TALLOC_ZERO_P(file->mem_ctx, REGF_HBIN)) ) + if ( !(hbin = talloc_zero(file->mem_ctx, REGF_HBIN)) ) return NULL; hbin->file_off = offset; hbin->free_off = -1; @@ -1073,7 +1073,7 @@ static bool hbin_prs_key( REGF_FILE *file, REGF_HBIN *hbin, REGF_NK_REC *nk ) } } - if ( !(nk->sec_desc = TALLOC_ZERO_P( file->mem_ctx, REGF_SK_REC )) ) + if ( !(nk->sec_desc = talloc_zero( file->mem_ctx, REGF_SK_REC )) ) return False; nk->sec_desc->sk_off = nk->sk_off; if ( !hbin_prs_sk_rec( "sk_rec", sub_hbin, depth, nk->sec_desc )) @@ -1379,7 +1379,7 @@ REGF_NK_REC* regfio_rootkey( REGF_FILE *file ) if ( !file ) return NULL; - if ( !(nk = TALLOC_ZERO_P( file->mem_ctx, REGF_NK_REC )) ) { + if ( !(nk = talloc_zero( file->mem_ctx, REGF_NK_REC )) ) { DEBUG(0,("regfio_rootkey: talloc() failed!\n")); return NULL; } @@ -1447,7 +1447,7 @@ REGF_NK_REC* regfio_rootkey( REGF_FILE *file ) return NULL; nk->subkey_index++; - if ( !(subkey = TALLOC_ZERO_P( file->mem_ctx, REGF_NK_REC )) ) + if ( !(subkey = talloc_zero( file->mem_ctx, REGF_NK_REC )) ) return NULL; if ( !hbin_prs_key( file, hbin, subkey ) ) @@ -1465,7 +1465,7 @@ static REGF_HBIN* regf_hbin_allocate( REGF_FILE *file, uint32 block_size ) REGF_HBIN *hbin; SMB_STRUCT_STAT sbuf; - if ( !(hbin = TALLOC_ZERO_P( file->mem_ctx, REGF_HBIN )) ) + if ( !(hbin = talloc_zero( file->mem_ctx, REGF_HBIN )) ) return NULL; memcpy( hbin->header, "hbin", sizeof(HBIN_HDR_SIZE) ); @@ -1765,7 +1765,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) REGF_HBIN *vlist_hbin = NULL; uint32 size; - if ( !(nk = TALLOC_ZERO_P( file->mem_ctx, REGF_NK_REC )) ) + if ( !(nk = talloc_zero( file->mem_ctx, REGF_NK_REC )) ) return NULL; memcpy( nk->header, "nk", REC_HDR_SIZE ); @@ -1831,7 +1831,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 ) return NULL; } - if ( !(nk->sec_desc = TALLOC_ZERO_P( file->mem_ctx, REGF_SK_REC )) ) + if ( !(nk->sec_desc = talloc_zero( file->mem_ctx, REGF_SK_REC )) ) return NULL; /* now we have to store the security descriptor in the list and |