diff options
author | Jeremy Allison <jra@samba.org> | 2007-04-27 23:18:41 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-04-27 23:18:41 +0000 |
commit | 04fd9ba97be2034004c20eab00c89099e6883bea (patch) | |
tree | d72ebd488852f73cd035da10e2215d243d0fb354 | |
parent | 3d32042d58bdb4b9f4e6564ced87efc88478681b (diff) | |
download | samba-04fd9ba97be2034004c20eab00c89099e6883bea.tar.gz samba-04fd9ba97be2034004c20eab00c89099e6883bea.tar.xz samba-04fd9ba97be2034004c20eab00c89099e6883bea.zip |
r22542: Move over to using the _strict varients of the talloc
calls. No functional changes. Looks bigger than it is :-).
Jeremy.
35 files changed, 147 insertions, 94 deletions
diff --git a/source/auth/auth_util.c b/source/auth/auth_util.c index 4e9e6f85f66..272ea902c47 100644 --- a/source/auth/auth_util.c +++ b/source/auth/auth_util.c @@ -1179,9 +1179,9 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username, goto done; } - group_sids = talloc_array(tmp_ctx, DOM_SID, num_group_sids); + group_sids = TALLOC_ARRAY(tmp_ctx, DOM_SID, num_group_sids); if (group_sids == NULL) { - DEBUG(1, ("talloc_array failed\n")); + DEBUG(1, ("TALLOC_ARRAY failed\n")); result = NT_STATUS_NO_MEMORY; goto done; } @@ -1209,9 +1209,9 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username, uint32 dummy; num_group_sids = 1; - group_sids = talloc_array(tmp_ctx, DOM_SID, num_group_sids); + group_sids = TALLOC_ARRAY(tmp_ctx, DOM_SID, num_group_sids); if (group_sids == NULL) { - DEBUG(1, ("talloc_array failed\n")); + DEBUG(1, ("TALLOC_ARRAY failed\n")); result = NT_STATUS_NO_MEMORY; goto done; } @@ -1462,7 +1462,7 @@ static auth_serversupplied_info *copy_serverinfo(auth_serversupplied_info *src) dst->gid = src->gid; dst->n_groups = src->n_groups; if (src->n_groups != 0) { - dst->groups = (gid_t *)talloc_memdup( + dst->groups = (gid_t *)TALLOC_MEMDUP( dst, src->groups, sizeof(gid_t)*dst->n_groups); } else { dst->groups = NULL; @@ -2027,11 +2027,11 @@ NT_USER_TOKEN *dup_nt_token(TALLOC_CTX *mem_ctx, const NT_USER_TOKEN *ptoken) ZERO_STRUCTP(token); if (ptoken->user_sids && ptoken->num_sids) { - token->user_sids = (DOM_SID *)talloc_memdup( + token->user_sids = (DOM_SID *)TALLOC_MEMDUP( token, ptoken->user_sids, sizeof(DOM_SID) * ptoken->num_sids ); if (token->user_sids == NULL) { - DEBUG(0, ("talloc_memdup failed\n")); + DEBUG(0, ("TALLOC_MEMDUP failed\n")); TALLOC_FREE(token); return NULL; } diff --git a/source/include/smb_macros.h b/source/include/smb_macros.h index c433ac2dc43..d5eac55181a 100644 --- a/source/include/smb_macros.h +++ b/source/include/smb_macros.h @@ -271,17 +271,19 @@ copy an IP address from one buffer to another /* The new talloc is paranoid malloc checker safe. */ -#define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__) -#define TALLOC_P(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type) -#define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type) -#define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup(ctx, ptr, size, __location__) -#define TALLOC_ZERO(ctx, size) _talloc_zero(ctx, size, __location__) -#define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type) -#define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type) +#define TALLOC(ctx, size) talloc_strict(ctx, size, __location__) +#define TALLOC_P(ctx, type) (type *)talloc_strict(ctx, sizeof(type), #type) +#define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array_strict(ctx, sizeof(type), count, #type) +#define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup_strict(ctx, ptr, size, __location__) +#define TALLOC_ZERO(ctx, size) _talloc_zero_strict(ctx, size, __location__) +#define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero_strict(ctx, sizeof(type), #type) +#define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array_strict(ctx, sizeof(type), count, #type) #define TALLOC_REALLOC(ctx, ptr, count) _talloc_realloc(ctx, ptr, count, __location__) #define TALLOC_REALLOC_ARRAY(ctx, ptr, type, count) (type *)_talloc_realloc_array(ctx, ptr, sizeof(type), count, #type) #define talloc_destroy(ctx) talloc_free(ctx) #define TALLOC_FREE(ctx) do { if ((ctx) != NULL) {talloc_free(ctx); ctx=NULL;} } while(0) +#define TALLOC_SIZE(ctx, size) talloc_strict(ctx, size) +#define TALLOC_ZERO_SIZE(ctx, size) talloc_zero_size_strict(ctx, size) /* only define PARANOID_MALLOC_CHECKER with --enable-developer and not compiling the smbmount utils */ diff --git a/source/lib/data_blob.c b/source/lib/data_blob.c index c7eadc1acfb..e07247bc49e 100644 --- a/source/lib/data_blob.c +++ b/source/lib/data_blob.c @@ -72,7 +72,7 @@ DATA_BLOB data_blob_talloc(TALLOC_CTX *mem_ctx, const void *p, size_t length) if (p) { ret.data = (uint8 *)TALLOC_MEMDUP(mem_ctx, p, length); if (ret.data == NULL) - smb_panic("data_blob_talloc: talloc_memdup failed.\n"); + smb_panic("data_blob_talloc: TALLOC_MEMDUP failed.\n"); } else { ret.data = (uint8 *)TALLOC(mem_ctx, length); if (ret.data == NULL) diff --git a/source/libaddns/dns.h b/source/libaddns/dns.h index 6f480a54695..bbc4b68656f 100644 --- a/source/libaddns/dns.h +++ b/source/libaddns/dns.h @@ -88,13 +88,13 @@ #include <talloc.h> -#define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__) -#define TALLOC_P(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type) -#define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type) -#define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup(ctx, ptr, size, __location__) -#define TALLOC_ZERO(ctx, size) _talloc_zero(ctx, size, __location__) -#define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type) -#define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type) +#define TALLOC(ctx, size) talloc_strict(ctx, size, __location__) +#define TALLOC_P(ctx, type) (type *)talloc_strict(ctx, sizeof(type), #type) +#define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array_strict(ctx, sizeof(type), count, #type) +#define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup_strict(ctx, ptr, size, __location__) +#define TALLOC_ZERO(ctx, size) _talloc_zero_strict(ctx, size, __location__) +#define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero_strict(ctx, sizeof(type), #type) +#define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array_strict(ctx, sizeof(type), count, #type) #define TALLOC_REALLOC(ctx, ptr, count) _talloc_realloc(ctx, ptr, count, __location__) #define TALLOC_REALLOC_ARRAY(ctx, ptr, type, count) (type *)_talloc_realloc_array(ctx, ptr, sizeof(type), count, #type) #define TALLOC_FREE(ctx) do { if ((ctx) != NULL) {talloc_free(ctx); ctx=NULL;} } while(0) diff --git a/source/libmsrpc/cac_samr.c b/source/libmsrpc/cac_samr.c index e85142af906..e50fb474f51 100644 --- a/source/libmsrpc/cac_samr.c +++ b/source/libmsrpc/cac_samr.c @@ -176,7 +176,7 @@ DOM_SID *cac_get_domain_sid( CacServerHandle * hnd, TALLOC_CTX * mem_ctx, if ( !fs.out.domain_sid ) return NULL; - sid = ( DOM_SID * ) talloc_memdup( mem_ctx, + sid = ( DOM_SID * ) TALLOC_MEMDUP( mem_ctx, &( fs.out.domain_sid->sid ), sizeof( DOM_SID ) ); @@ -718,13 +718,13 @@ int cac_SamGetGroupsForUser( CacServerHandle * hnd, TALLOC_CTX * mem_ctx, return CAC_FAILURE; - rids_out = talloc_array( mem_ctx, uint32, num_groups_out ); + rids_out = TALLOC_ARRAY( mem_ctx, uint32, num_groups_out ); if ( !rids_out ) { hnd->status = NT_STATUS_NO_MEMORY; return CAC_FAILURE; } - attr_out = talloc_array( mem_ctx, uint32, num_groups_out ); + attr_out = TALLOC_ARRAY( mem_ctx, uint32, num_groups_out ); if ( !attr_out ) { hnd->status = NT_STATUS_NO_MEMORY; return CAC_FAILURE; @@ -1153,14 +1153,14 @@ int cac_SamEnumGroups( CacServerHandle * hnd, TALLOC_CTX * mem_ctx, return CAC_FAILURE; } - names_out = talloc_array( mem_ctx, char *, num_groups_out ); + names_out = TALLOC_ARRAY( mem_ctx, char *, num_groups_out ); if ( !names_out ) { hnd->status = NT_STATUS_NO_MEMORY; TALLOC_FREE( acct_buf ); return CAC_FAILURE; } - desc_out = talloc_array( mem_ctx, char *, num_groups_out ); + desc_out = TALLOC_ARRAY( mem_ctx, char *, num_groups_out ); if ( !desc_out ) { hnd->status = NT_STATUS_NO_MEMORY; TALLOC_FREE( acct_buf ); @@ -1168,7 +1168,7 @@ int cac_SamEnumGroups( CacServerHandle * hnd, TALLOC_CTX * mem_ctx, return CAC_FAILURE; } - rids_out = talloc_array( mem_ctx, uint32, num_groups_out ); + rids_out = TALLOC_ARRAY( mem_ctx, uint32, num_groups_out ); if ( !rids_out ) { hnd->status = NT_STATUS_NO_MEMORY; TALLOC_FREE( acct_buf ); @@ -1256,14 +1256,14 @@ int cac_SamEnumAliases( CacServerHandle * hnd, TALLOC_CTX * mem_ctx, NT_STATUS_V( STATUS_MORE_ENTRIES ) ) return CAC_FAILURE; - names_out = talloc_array( mem_ctx, char *, num_als_out ); + names_out = TALLOC_ARRAY( mem_ctx, char *, num_als_out ); if ( !names_out ) { hnd->status = NT_STATUS_NO_MEMORY; TALLOC_FREE( acct_buf ); return CAC_FAILURE; } - desc_out = talloc_array( mem_ctx, char *, num_als_out ); + desc_out = TALLOC_ARRAY( mem_ctx, char *, num_als_out ); if ( !desc_out ) { hnd->status = NT_STATUS_NO_MEMORY; TALLOC_FREE( acct_buf ); @@ -1271,7 +1271,7 @@ int cac_SamEnumAliases( CacServerHandle * hnd, TALLOC_CTX * mem_ctx, return CAC_FAILURE; } - rids_out = talloc_array( mem_ctx, uint32, num_als_out ); + rids_out = TALLOC_ARRAY( mem_ctx, uint32, num_als_out ); if ( !rids_out ) { hnd->status = NT_STATUS_NO_MEMORY; TALLOC_FREE( acct_buf ); diff --git a/source/libmsrpc/cac_winreg.c b/source/libmsrpc/cac_winreg.c index 1546cfeda4c..35d77566144 100644 --- a/source/libmsrpc/cac_winreg.c +++ b/source/libmsrpc/cac_winreg.c @@ -611,7 +611,7 @@ int cac_RegQueryKeyInfo( CacServerHandle * hnd, TALLOC_CTX * mem_ctx, } else if ( class_len != 0 && class_name_out[class_len - 1] != '\0' ) { /*then we need to add a '\0' */ op->out.class_name = - talloc_size( mem_ctx, + TALLOC_SIZE( mem_ctx, sizeof( char ) * ( class_len + 1 ) ); memcpy( op->out.class_name, class_name_out, class_len ); @@ -735,21 +735,21 @@ int cac_RegEnumValues( CacServerHandle * hnd, TALLOC_CTX * mem_ctx, /*we need to assume that the max number of values will be enumerated */ types_out = - ( uint32 * ) talloc_array( mem_ctx, int, op->in.max_values ); + ( uint32 * ) TALLOC_ARRAY( mem_ctx, int, op->in.max_values ); if ( !types_out ) { hnd->status = NT_STATUS_NO_MEMORY; return CAC_FAILURE; } values_out = - talloc_array( mem_ctx, REG_VALUE_DATA *, op->in.max_values ); + TALLOC_ARRAY( mem_ctx, REG_VALUE_DATA *, op->in.max_values ); if ( !values_out ) { TALLOC_FREE( types_out ); hnd->status = NT_STATUS_NO_MEMORY; return CAC_FAILURE; } - val_names_out = talloc_array( mem_ctx, char *, op->in.max_values ); + val_names_out = TALLOC_ARRAY( mem_ctx, char *, op->in.max_values ); if ( !val_names_out ) { TALLOC_FREE( types_out ); TALLOC_FREE( values_out ); diff --git a/source/libmsrpc/libmsrpc_internal.c b/source/libmsrpc/libmsrpc_internal.c index c062b47ede5..bea96fdb007 100644 --- a/source/libmsrpc/libmsrpc_internal.c +++ b/source/libmsrpc/libmsrpc_internal.c @@ -200,7 +200,7 @@ char *cac_unistr_to_str( TALLOC_CTX * mem_ctx, uint16 * src, int num_bytes ) /*need room for a '\0' */ str_len++; - buf = talloc_array( mem_ctx, char, str_len ); + buf = TALLOC_ARRAY( mem_ctx, char, str_len ); if ( !buf ) { return NULL; @@ -265,7 +265,7 @@ REG_VALUE_DATA *cac_MakeRegValueData( TALLOC_CTX * mem_ctx, uint32 data_type, data->reg_binary.data_length = size; data->reg_binary.data = - ( uint8 * ) talloc_memdup( mem_ctx, buf.buffer, + ( uint8 * ) TALLOC_MEMDUP( mem_ctx, buf.buffer, size ); if ( !data->reg_binary.data ) { TALLOC_FREE( data ); @@ -296,7 +296,7 @@ REG_VALUE_DATA *cac_MakeRegValueData( TALLOC_CTX * mem_ctx, uint32 data_type, break; } - strings = talloc_array( mem_ctx, char *, num_strings ); + strings = TALLOC_ARRAY( mem_ctx, char *, num_strings ); if ( !strings ) { errno = ENOMEM; @@ -424,7 +424,7 @@ char *talloc_unistr2_to_ascii( TALLOC_CTX * mem_ctx, UNISTR2 str ) if ( !mem_ctx ) return NULL; - buf = talloc_array( mem_ctx, char, ( str.uni_str_len + 1 ) ); + buf = TALLOC_ARRAY( mem_ctx, char, ( str.uni_str_len + 1 ) ); if ( !buf ) return NULL; @@ -514,7 +514,7 @@ CacUserInfo *cac_MakeUserInfo( TALLOC_CTX * mem_ctx, SAM_USERINFO_CTR * ctr ) memcpy( info->lm_password, id21->lm_pwd, 8 ); info->logon_hours = - ( LOGON_HRS * ) talloc_memdup( mem_ctx, &( id21->logon_hrs ), + ( LOGON_HRS * ) TALLOC_MEMDUP( mem_ctx, &( id21->logon_hrs ), sizeof( LOGON_HRS ) ); if ( !info->logon_hours ) return NULL; diff --git a/source/libsmb/cliquota.c b/source/libsmb/cliquota.c index 5627d28bb5d..2a47ae24632 100644 --- a/source/libsmb/cliquota.c +++ b/source/libsmb/cliquota.c @@ -322,13 +322,13 @@ BOOL cli_list_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_LIST } if ((tmp_list_ent=TALLOC_ZERO_P(mem_ctx,SMB_NTQUOTA_LIST))==NULL) { - DEBUG(0,("talloc_zero() failed\n")); + DEBUG(0,("TALLOC_ZERO() failed\n")); talloc_destroy(mem_ctx); return (-1); } if ((tmp_list_ent->quotas=TALLOC_ZERO_P(mem_ctx,SMB_NTQUOTA_STRUCT))==NULL) { - DEBUG(0,("talloc_zero() failed\n")); + DEBUG(0,("TALLOC_ZERO() failed\n")); talloc_destroy(mem_ctx); return (-1); } @@ -382,13 +382,13 @@ BOOL cli_list_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_LIST } if ((tmp_list_ent=TALLOC_ZERO_P(mem_ctx,SMB_NTQUOTA_LIST))==NULL) { - DEBUG(0,("talloc_zero() failed\n")); + DEBUG(0,("TALLOC_ZERO() failed\n")); talloc_destroy(mem_ctx); goto cleanup; } if ((tmp_list_ent->quotas=TALLOC_ZERO_P(mem_ctx,SMB_NTQUOTA_STRUCT))==NULL) { - DEBUG(0,("talloc_zero() failed\n")); + DEBUG(0,("TALLOC_ZERO() failed\n")); talloc_destroy(mem_ctx); goto cleanup; } diff --git a/source/locking/locking.c b/source/locking/locking.c index 37e6dbc4e54..2181fca4085 100644 --- a/source/locking/locking.c +++ b/source/locking/locking.c @@ -521,7 +521,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck) } lck->share_modes = (struct share_mode_entry *) - talloc_memdup(lck, dbuf.dptr+sizeof(*data), + TALLOC_MEMDUP(lck, dbuf.dptr+sizeof(*data), lck->num_share_modes * sizeof(struct share_mode_entry)); diff --git a/source/modules/nfs4_acls.c b/source/modules/nfs4_acls.c index dd452408579..b6bcc8cd47f 100644 --- a/source/modules/nfs4_acls.c +++ b/source/modules/nfs4_acls.c @@ -84,10 +84,10 @@ static SMB_ACE4_INT_T *get_validated_aceint(SMB4ACE_T *ace) SMB4ACL_T *smb_create_smb4acl(void) { TALLOC_CTX *mem_ctx = main_loop_talloc_get(); - SMB_ACL4_INT_T *acl = (SMB_ACL4_INT_T *)talloc_size(mem_ctx, sizeof(SMB_ACL4_INT_T)); + SMB_ACL4_INT_T *acl = (SMB_ACL4_INT_T *)TALLOC_SIZE(mem_ctx, sizeof(SMB_ACL4_INT_T)); if (acl==NULL) { - DEBUG(0, ("talloc_size failed\n")); + DEBUG(0, ("TALLOC_SIZE failed\n")); errno = ENOMEM; return NULL; } @@ -103,10 +103,10 @@ SMB4ACE_T *smb_add_ace4(SMB4ACL_T *acl, SMB_ACE4PROP_T *prop) TALLOC_CTX *mem_ctx = main_loop_talloc_get(); SMB_ACE4_INT_T *ace; - ace = (SMB_ACE4_INT_T *)talloc_size(mem_ctx, sizeof(SMB_ACE4_INT_T)); + ace = (SMB_ACE4_INT_T *)TALLOC_SIZE(mem_ctx, sizeof(SMB_ACE4_INT_T)); if (ace==NULL) { - DEBUG(0, ("talloc_size failed\n")); + DEBUG(0, ("TALLOC_SIZE failed\n")); errno = ENOMEM; return NULL; } @@ -206,7 +206,7 @@ static BOOL smbacl4_nfs42win(SMB4ACL_T *acl, /* in */ if (aclint==NULL) return False; - nt_ace_list = (SEC_ACE *)talloc_size(mem_ctx, aclint->naces * sizeof(SEC_ACE)); + nt_ace_list = (SEC_ACE *)TALLOC_SIZE(mem_ctx, aclint->naces * sizeof(SEC_ACE)); if (nt_ace_list==NULL) { DEBUG(10, ("talloc error")); diff --git a/source/modules/vfs_aixacl2.c b/source/modules/vfs_aixacl2.c index 62a517a6e08..f1e116ec197 100644 --- a/source/modules/vfs_aixacl2.c +++ b/source/modules/vfs_aixacl2.c @@ -68,7 +68,7 @@ static AIXJFS2_ACL_T *aixjfs2_getacl_alloc(const char *fname, acl_type_t *type) TALLOC_CTX *mem_ctx; mem_ctx = main_loop_talloc_get(); - acl = (AIXJFS2_ACL_T *)talloc_size(mem_ctx, len); + acl = (AIXJFS2_ACL_T *)TALLOC_SIZE(mem_ctx, len); if (acl == NULL) { errno = ENOMEM; return NULL; @@ -83,7 +83,7 @@ static AIXJFS2_ACL_T *aixjfs2_getacl_alloc(const char *fname, acl_type_t *type) len = aixacl2_getlen(acl, type) + sizeof(AIXJFS2_ACL_T); DEBUG(10,("aixjfs2_getacl_alloc - acl_len:%d\n",len)); - acl = (AIXJFS2_ACL_T *)talloc_size(mem_ctx, len); + acl = (AIXJFS2_ACL_T *)TALLOC_SIZE(mem_ctx, len); if (acl == NULL) { errno = ENOMEM; return NULL; @@ -312,9 +312,9 @@ static BOOL aixjfs2_process_smbacl(files_struct *fsp, SMB4ACL_T *smbacl) naces = smb_get_naces(smbacl); aclLen = ACL_V4_SIZ + naces * entryLen; - jfs2acl = (nfs4_acl_int_t *)talloc_size(mem_ctx, aclLen); + jfs2acl = (nfs4_acl_int_t *)TALLOC_SIZE(mem_ctx, aclLen); if (jfs2acl==NULL) { - DEBUG(0, ("talloc_size failed\n")); + DEBUG(0, ("TALLOC_SIZE failed\n")); errno = ENOMEM; return False; } diff --git a/source/modules/vfs_gpfs.c b/source/modules/vfs_gpfs.c index 6841300d5b3..932b5000c83 100644 --- a/source/modules/vfs_gpfs.c +++ b/source/modules/vfs_gpfs.c @@ -104,7 +104,7 @@ static struct gpfs_acl *gpfs_getacl_alloc(const char *fname, gpfs_aclType_t type int ret; TALLOC_CTX *mem_ctx = main_loop_talloc_get(); - acl = (struct gpfs_acl *)talloc_size(mem_ctx, len); + acl = (struct gpfs_acl *)TALLOC_SIZE(mem_ctx, len); if (acl == NULL) { errno = ENOMEM; return NULL; @@ -117,7 +117,7 @@ static struct gpfs_acl *gpfs_getacl_alloc(const char *fname, gpfs_aclType_t type ret = smbd_gpfs_getacl((char *)fname, GPFS_GETACL_STRUCT | GPFS_ACL_SAMBA, acl); if ((ret != 0) && (errno == ENOSPC)) { - struct gpfs_acl *new_acl = (struct gpfs_acl *)talloc_size( + struct gpfs_acl *new_acl = (struct gpfs_acl *)TALLOC_SIZE( mem_ctx, acl->acl_len + sizeof(struct gpfs_acl)); if (new_acl == NULL) { errno = ENOMEM; @@ -260,7 +260,7 @@ static BOOL gpfsacl_process_smbacl(files_struct *fsp, SMB4ACL_T *smbacl) gacl_len = sizeof(struct gpfs_acl) + (smb_get_naces(smbacl)-1)*sizeof(gpfs_ace_v4_t); - gacl = talloc_size(mem_ctx, gacl_len); + gacl = TALLOC_SIZE(mem_ctx, gacl_len); if (gacl == NULL) { DEBUG(0, ("talloc failed\n")); errno = ENOMEM; diff --git a/source/nsswitch/idmap.c b/source/nsswitch/idmap.c index 7589ee66abd..26fcc692e9e 100644 --- a/source/nsswitch/idmap.c +++ b/source/nsswitch/idmap.c @@ -360,7 +360,7 @@ NTSTATUS idmap_init(void) } /* init domain */ - dom = talloc_zero(idmap_ctx, struct idmap_domain); + dom = TALLOC_ZERO_P(idmap_ctx, struct idmap_domain); IDMAP_CHECK_ALLOC(dom); dom->name = talloc_strdup(dom, dom_list[i]); @@ -464,7 +464,7 @@ NTSTATUS idmap_init(void) ( ! pri_dom_is_in_list) && lp_winbind_trusted_domains_only()) { - dom = talloc_zero(idmap_ctx, struct idmap_domain); + dom = TALLOC_ZERO_P(idmap_ctx, struct idmap_domain); IDMAP_CHECK_ALLOC(dom); dom->name = talloc_strdup(dom, lp_workgroup()); @@ -515,7 +515,7 @@ NTSTATUS idmap_init(void) } /**** automatically add idmap_passdb backend ****/ - dom = talloc_zero(idmap_ctx, struct idmap_domain); + dom = TALLOC_ZERO_P(idmap_ctx, struct idmap_domain); IDMAP_CHECK_ALLOC(dom); dom->name = talloc_strdup(dom, get_global_sam_name()); @@ -607,7 +607,7 @@ NTSTATUS idmap_init(void) if ( alloc_backend ) { - idmap_alloc_ctx = talloc_zero(idmap_ctx, struct idmap_alloc_context); + idmap_alloc_ctx = TALLOC_ZERO_P(idmap_ctx, struct idmap_alloc_context); IDMAP_CHECK_ALLOC(idmap_alloc_ctx); idmap_alloc_ctx->methods = get_alloc_methods(alloc_backends, alloc_backend); @@ -1026,9 +1026,9 @@ static NTSTATUS idmap_backends_sids_to_unixids(struct id_map **ids) /* split list per domain */ - dom_ids = talloc_zero_array(ctx, struct id_map **, num_domains); + dom_ids = TALLOC_ZERO_ARRAY(ctx, struct id_map **, num_domains); IDMAP_CHECK_ALLOC(dom_ids); - counters = talloc_zero_array(ctx, int, num_domains); + counters = TALLOC_ZERO_ARRAY(ctx, int, num_domains); /* partition the requests by domain */ @@ -1143,7 +1143,7 @@ NTSTATUS idmap_unixids_to_sids(struct id_map **ids) if ( ! bids) { /* alloc space for ids to be resolved by backends (realloc ten by ten) */ - bids = talloc_array(ctx, struct id_map *, 10); + bids = TALLOC_ARRAY(ctx, struct id_map *, 10); if ( ! bids) { DEBUG(1, ("Out of memory!\n")); talloc_free(ctx); @@ -1248,7 +1248,7 @@ NTSTATUS idmap_sids_to_unixids(struct id_map **ids) if ( ! bids) { /* alloc space for ids to be resolved by backends (realloc ten by ten) */ - bids = talloc_array(ctx, struct id_map *, 10); + bids = TALLOC_ARRAY(ctx, struct id_map *, 10); if ( ! bids) { DEBUG(1, ("Out of memory!\n")); talloc_free(ctx); diff --git a/source/nsswitch/idmap_ad.c b/source/nsswitch/idmap_ad.c index e15e4b90fb8..d3fd9e1c8aa 100644 --- a/source/nsswitch/idmap_ad.c +++ b/source/nsswitch/idmap_ad.c @@ -167,7 +167,7 @@ static NTSTATUS idmap_ad_initialize(struct idmap_domain *dom) const char *range = NULL; const char *schema_mode = NULL; - if ( (ctx = talloc_zero(dom, struct idmap_ad_context)) == NULL ) { + if ( (ctx = TALLOC_ZERO(dom, struct idmap_ad_context)) == NULL ) { DEBUG(0, ("Out of memory!\n")); return NT_STATUS_NO_MEMORY; } diff --git a/source/nsswitch/idmap_ldap.c b/source/nsswitch/idmap_ldap.c index e6cd5c7f231..f3cf3278d4b 100644 --- a/source/nsswitch/idmap_ldap.c +++ b/source/nsswitch/idmap_ldap.c @@ -215,7 +215,7 @@ static NTSTATUS idmap_ldap_alloc_init(const char *params) return NT_STATUS_FILE_IS_OFFLINE; } - idmap_alloc_ldap = talloc_zero(NULL, struct idmap_ldap_alloc_context); + idmap_alloc_ldap = TALLOC_ZERO_P(NULL, struct idmap_ldap_alloc_context); CHECK_ALLOC_DONE( idmap_alloc_ldap ); /* load ranges */ @@ -734,7 +734,7 @@ static NTSTATUS idmap_ldap_db_init(struct idmap_domain *dom) return NT_STATUS_FILE_IS_OFFLINE; } - ctx = talloc_zero(dom, struct idmap_ldap_context); + ctx = TALLOC_ZERO_P(dom, struct idmap_ldap_context); if ( ! ctx) { DEBUG(0, ("Out of memory!\n")); return NT_STATUS_NO_MEMORY; diff --git a/source/nsswitch/idmap_rid.c b/source/nsswitch/idmap_rid.c index 8e016879b8c..1daf511ddae 100644 --- a/source/nsswitch/idmap_rid.c +++ b/source/nsswitch/idmap_rid.c @@ -44,7 +44,7 @@ static NTSTATUS idmap_rid_initialize(struct idmap_domain *dom) char *config_option = NULL; const char *range; - if ( (ctx = talloc_zero(dom, struct idmap_rid_context)) == NULL ) { + if ( (ctx = TALLOC_ZERO(dom, struct idmap_rid_context)) == NULL ) { DEBUG(0, ("Out of memory!\n")); return NT_STATUS_NO_MEMORY; } diff --git a/source/nsswitch/idmap_tdb.c b/source/nsswitch/idmap_tdb.c index 8ce88e015d4..ec866519353 100644 --- a/source/nsswitch/idmap_tdb.c +++ b/source/nsswitch/idmap_tdb.c @@ -1198,7 +1198,7 @@ static NTSTATUS idmap_tdb_dump_data(struct idmap_domain *dom, struct id_map **ma ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context); - data = talloc_zero(ctx, struct dump_data); + data = TALLOC_ZERO_P(ctx, struct dump_data); if ( ! data) { DEBUG(0, ("Out of memory!\n")); return NT_STATUS_NO_MEMORY; diff --git a/source/nsswitch/winbindd_async.c b/source/nsswitch/winbindd_async.c index aa48f513e97..a8a92c3caea 100644 --- a/source/nsswitch/winbindd_async.c +++ b/source/nsswitch/winbindd_async.c @@ -276,13 +276,13 @@ enum winbindd_result winbindd_dual_sids2xids(struct winbindd_domain *domain, sids = (DOM_SID *)state->request.extra_data.data; num = state->request.extra_len / sizeof(DOM_SID); - ids = talloc_zero_array(state->mem_ctx, struct id_map *, num + 1); + ids = TALLOC_ZERO_ARRAY(state->mem_ctx, struct id_map *, num + 1); if ( ! ids) { DEBUG(0, ("Out of memory!\n")); return WINBINDD_ERROR; } for (i = 0; i < num; i++) { - ids[i] = talloc(ids, struct id_map); + ids[i] = TALLOC_P(ids, struct id_map); if ( ! ids[i]) { DEBUG(0, ("Out of memory!\n")); talloc_free(ids); diff --git a/source/printing/notify.c b/source/printing/notify.c index 7d5b7027819..9aef3a78c1b 100644 --- a/source/printing/notify.c +++ b/source/printing/notify.c @@ -222,7 +222,7 @@ static BOOL copy_notify2_msg( SPOOLSS_NOTIFY_MSG *to, SPOOLSS_NOTIFY_MSG *from ) if ( from->len ) { to->notify.data = (char *)TALLOC_MEMDUP(send_ctx, from->notify.data, from->len ); if ( !to->notify.data ) { - DEBUG(0,("copy_notify2_msg: talloc_memdup() of size [%d] failed!\n", from->len )); + DEBUG(0,("copy_notify2_msg: TALLOC_MEMDUP() of size [%d] failed!\n", from->len )); return False; } } diff --git a/source/rpc_parse/parse_buffer.c b/source/rpc_parse/parse_buffer.c index 5643189afea..b66eb9910a8 100644 --- a/source/rpc_parse/parse_buffer.c +++ b/source/rpc_parse/parse_buffer.c @@ -401,6 +401,9 @@ BOOL smb_io_relarraystr(const char *desc, RPC_BUFFER *buffer, int depth, uint16 { chaine2[l_chaine2] = '\0'; *string=(uint16 *)TALLOC_MEMDUP(prs_get_mem_context(ps),chaine2,realloc_size); + if (!*string) { + return False; + } SAFE_FREE(chaine2); } diff --git a/source/rpc_parse/parse_dfs.c b/source/rpc_parse/parse_dfs.c index e590aae0526..118429e7d2f 100644 --- a/source/rpc_parse/parse_dfs.c +++ b/source/rpc_parse/parse_dfs.c @@ -326,6 +326,9 @@ BOOL netdfs_io_dfs_Info3_d(const char *desc, NETDFS_DFS_INFO3 *v, prs_struct *ps if (UNMARSHALLING(ps)) { v->stores = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->stores)*v->num_stores); + if (!v->stores) { + return False; + } } for (i_stores_1=0; i_stores_1<v->num_stores;i_stores_1++) { if (!netdfs_io_dfs_StorageInfo_p("stores", &v->stores[i_stores_1], ps, depth)) @@ -448,6 +451,9 @@ BOOL netdfs_io_dfs_Info4_d(const char *desc, NETDFS_DFS_INFO4 *v, prs_struct *ps if (UNMARSHALLING(ps)) { v->stores = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->stores)*v->num_stores); + if (!v->stores) { + return False; + } } for (i_stores_1=0; i_stores_1<v->num_stores;i_stores_1++) { if (!netdfs_io_dfs_StorageInfo_p("stores", &v->stores[i_stores_1], ps, depth)) @@ -921,6 +927,9 @@ BOOL netdfs_io_dfs_EnumArray1_d(const char *desc, NETDFS_DFS_ENUMARRAY1 *v, prs_ if (UNMARSHALLING(ps)) { v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); + if (!v->s) { + return False; + } } for (i_s_1=0; i_s_1<v->count;i_s_1++) { if (!netdfs_io_dfs_Info1_p("s", &v->s[i_s_1], ps, depth)) @@ -987,6 +996,9 @@ BOOL netdfs_io_dfs_EnumArray2_d(const char *desc, NETDFS_DFS_ENUMARRAY2 *v, prs_ if (UNMARSHALLING(ps)) { v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); + if (!v->s) { + return False; + } } for (i_s_1=0; i_s_1<v->count;i_s_1++) { if (!netdfs_io_dfs_Info2_p("s", &v->s[i_s_1], ps, depth)) @@ -1053,6 +1065,9 @@ BOOL netdfs_io_dfs_EnumArray3_d(const char *desc, NETDFS_DFS_ENUMARRAY3 *v, prs_ if (UNMARSHALLING(ps)) { v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); + if (!v->s) { + return False; + } } for (i_s_1=0; i_s_1<v->count;i_s_1++) { if (!netdfs_io_dfs_Info3_p("s", &v->s[i_s_1], ps, depth)) @@ -1119,6 +1134,9 @@ BOOL netdfs_io_dfs_EnumArray4_d(const char *desc, NETDFS_DFS_ENUMARRAY4 *v, prs_ if (UNMARSHALLING(ps)) { v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); + if (!v->s) { + return False; + } } for (i_s_1=0; i_s_1<v->count;i_s_1++) { if (!netdfs_io_dfs_Info4_p("s", &v->s[i_s_1], ps, depth)) @@ -1185,6 +1203,9 @@ BOOL netdfs_io_dfs_EnumArray200_d(const char *desc, NETDFS_DFS_ENUMARRAY200 *v, if (UNMARSHALLING(ps)) { v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); + if (!v->s) { + return False; + } } for (i_s_1=0; i_s_1<v->count;i_s_1++) { if (!netdfs_io_dfs_Info200_p("s", &v->s[i_s_1], ps, depth)) @@ -1251,6 +1272,9 @@ BOOL netdfs_io_dfs_EnumArray300_d(const char *desc, NETDFS_DFS_ENUMARRAY300 *v, if (UNMARSHALLING(ps)) { v->s = (void *)PRS_ALLOC_MEM_VOID(ps,sizeof(*v->s)*v->count); + if (!v->s) { + return False; + } } for (i_s_1=0; i_s_1<v->count;i_s_1++) { if (!netdfs_io_dfs_Info300_p("s", &v->s[i_s_1], ps, depth)) diff --git a/source/rpc_parse/parse_eventlog.c b/source/rpc_parse/parse_eventlog.c index addf433feb8..436f35aff6a 100644 --- a/source/rpc_parse/parse_eventlog.c +++ b/source/rpc_parse/parse_eventlog.c @@ -354,7 +354,9 @@ BOOL eventlog_io_r_read_eventlog(const char *desc, /* Now pad with whitespace until the end of the response buffer */ if (q_u->max_read_size - r_u->num_bytes_in_resp) { - r_u->end_of_entries_padding = SMB_CALLOC_ARRAY(uint8, q_u->max_read_size - r_u->num_bytes_in_resp); + if (!r_u->end_of_entries_padding) { + return False; + } if(!(prs_uint8s(False, "end of entries padding", ps, depth, r_u->end_of_entries_padding, diff --git a/source/rpc_parse/parse_misc.c b/source/rpc_parse/parse_misc.c index 3b1e9a4f08e..8da3c90d250 100644 --- a/source/rpc_parse/parse_misc.c +++ b/source/rpc_parse/parse_misc.c @@ -268,7 +268,7 @@ BOOL smb_io_dom_sid2_p(const char *desc, prs_struct *ps, int depth, DOM_SID2 **s if (UNMARSHALLING(ps)) { if ( !(*sid2 = PRS_ALLOC_MEM(ps, DOM_SID2, 1)) ) - return False; + return False; } return True; diff --git a/source/rpc_parse/parse_net.c b/source/rpc_parse/parse_net.c index 2ccc9f59f68..aa53b35594c 100644 --- a/source/rpc_parse/parse_net.c +++ b/source/rpc_parse/parse_net.c @@ -2911,7 +2911,16 @@ static BOOL net_io_sam_privs_info(const char *desc, SAM_DELTA_PRIVS *info, if(!prs_uint32("attribute_count", ps, depth, &info->attribute_count)) return False; - info->attributes = TALLOC_ARRAY(ps->mem_ctx, uint32, info->attribute_count); + if (UNMARSHALLING(ps)) { + if (info->attribute_count) { + info->attributes = TALLOC_ARRAY(ps->mem_ctx, uint32, info->attribute_count); + if (!info->attributes) { + return False; + } + } else { + info->attributes = NULL; + } + } for (i=0; i<info->attribute_count; i++) if(!prs_uint32("attributes", ps, depth, &info->attributes[i])) @@ -2920,8 +2929,21 @@ static BOOL net_io_sam_privs_info(const char *desc, SAM_DELTA_PRIVS *info, if(!prs_uint32("privlist_count", ps, depth, &info->privlist_count)) return False; - info->hdr_privslist = TALLOC_ARRAY(ps->mem_ctx, UNIHDR, info->privlist_count); - info->uni_privslist = TALLOC_ARRAY(ps->mem_ctx, UNISTR2, info->privlist_count); + if (UNMARSHALLING(ps)) { + if (info->privlist_count) { + info->hdr_privslist = TALLOC_ARRAY(ps->mem_ctx, UNIHDR, info->privlist_count); + info->uni_privslist = TALLOC_ARRAY(ps->mem_ctx, UNISTR2, info->privlist_count); + if (!info->hdr_privslist) { + return False; + } + if (!info->uni_privslist) { + return False; + } + } else { + info->hdr_privslist = NULL; + info->uni_privslist = NULL; + } + } for (i=0; i<info->privlist_count; i++) if(!smb_io_unihdr("hdr_privslist", &info->hdr_privslist[i], ps, depth)) diff --git a/source/rpc_parse/parse_prs.c b/source/rpc_parse/parse_prs.c index 540db5b6a85..a86633a43b7 100644 --- a/source/rpc_parse/parse_prs.c +++ b/source/rpc_parse/parse_prs.c @@ -156,9 +156,9 @@ char *prs_alloc_mem(prs_struct *ps, size_t size, unsigned int count) { char *ret = NULL; - if (size) { + if (size && count) { /* We can't call the type-safe version here. */ - ret = (char *)_talloc_zero_array(ps->mem_ctx, size, count, + ret = (char *)_talloc_zero_array_strict(ps->mem_ctx, size, count, "parse_prs"); } return ret; @@ -1817,7 +1817,7 @@ return the contents of a prs_struct in a DATA_BLOB BOOL prs_data_blob(prs_struct *prs, DATA_BLOB *blob, TALLOC_CTX *mem_ctx) { blob->length = prs_data_size(prs); - blob->data = (uint8 *)talloc_zero_size(mem_ctx, blob->length); + blob->data = (uint8 *)TALLOC_ZERO_SIZE(mem_ctx, blob->length); /* set the pointer at the end of the buffer */ prs_set_offset( prs, prs_data_size(prs) ); diff --git a/source/rpc_server/srv_samr_nt.c b/source/rpc_server/srv_samr_nt.c index db0dc7f5e8a..f1da02cb373 100644 --- a/source/rpc_server/srv_samr_nt.c +++ b/source/rpc_server/srv_samr_nt.c @@ -869,7 +869,7 @@ static NTSTATUS make_user_sam_entry_list(TALLOC_CTX *ctx, SAM_ENTRY **sam_pp, uni_name = TALLOC_ZERO_ARRAY(ctx, UNISTR2, num_entries); if (sam == NULL || uni_name == NULL) { - DEBUG(0, ("make_user_sam_entry_list: talloc_zero failed!\n")); + DEBUG(0, ("make_user_sam_entry_list: TALLOC_ZERO failed!\n")); return NT_STATUS_NO_MEMORY; } diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c index 6b6306337cc..1cd2245457d 100644 --- a/source/rpc_server/srv_spoolss_nt.c +++ b/source/rpc_server/srv_spoolss_nt.c @@ -9371,7 +9371,7 @@ WERROR _spoolss_enumprinterdataex(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATAEX *q_ if ( data_len ) { if ( !(enum_values[i].data = TALLOC_MEMDUP(p->mem_ctx, regval_data_p(val), data_len)) ) { - DEBUG(0,("talloc_memdup failed to allocate memory [data_len=%d] for data!\n", + DEBUG(0,("TALLOC_MEMDUP failed to allocate memory [data_len=%d] for data!\n", data_len )); result = WERR_NOMEM; goto done; diff --git a/source/smbd/conn.c b/source/smbd/conn.c index 44888b777f2..282a82ce049 100644 --- a/source/smbd/conn.c +++ b/source/smbd/conn.c @@ -148,7 +148,7 @@ find_again: if (!(conn=TALLOC_ZERO_P(mem_ctx, connection_struct)) || !(conn->params = TALLOC_P(mem_ctx, struct share_params))) { - DEBUG(0,("talloc_zero() failed!\n")); + DEBUG(0,("TALLOC_ZERO() failed!\n")); TALLOC_FREE(mem_ctx); return NULL; } diff --git a/source/smbd/fake_file.c b/source/smbd/fake_file.c index 208b3256673..5333742ba81 100644 --- a/source/smbd/fake_file.c +++ b/source/smbd/fake_file.c @@ -49,7 +49,7 @@ static struct _FAKE_FILE_HANDLE *init_fake_file_handle(enum FAKE_FILE_TYPE type) } if ((fh =TALLOC_ZERO_P(mem_ctx, FAKE_FILE_HANDLE))==NULL) { - DEBUG(0,("talloc_zero() failed.\n")); + DEBUG(0,("TALLOC_ZERO() failed.\n")); talloc_destroy(mem_ctx); return NULL; } diff --git a/source/smbd/notify_inotify.c b/source/smbd/notify_inotify.c index ff17d455f39..1b1bad7e966 100644 --- a/source/smbd/notify_inotify.c +++ b/source/smbd/notify_inotify.c @@ -235,7 +235,7 @@ static void inotify_handler(struct event_context *ev, struct fd_event *fde, return; } - e0 = e = (struct inotify_event *)talloc_size(in, bufsize); + e0 = e = (struct inotify_event *)TALLOC_SIZE(in, bufsize); if (e == NULL) return; if (read(in->fd, e0, bufsize) != bufsize) { diff --git a/source/smbd/notify_internal.c b/source/smbd/notify_internal.c index 72b96049350..d2b69c9d9e6 100644 --- a/source/smbd/notify_internal.c +++ b/source/smbd/notify_internal.c @@ -156,7 +156,7 @@ static NTSTATUS notify_load(struct notify_context *notify) notify->seqnum = seqnum; talloc_free(notify->array); - notify->array = talloc_zero(notify, struct notify_array); + notify->array = TALLOC_ZERO_P(notify, struct notify_array); NT_STATUS_HAVE_NO_MEMORY(notify->array); dbuf = tdb_fetch_bystring(notify->w->tdb, NOTIFY_KEY); @@ -385,7 +385,7 @@ NTSTATUS notify_add(struct notify_context *notify, struct notify_entry *e0, depth = count_chars(e.path, '/'); - listel = talloc_zero(notify, struct notify_list); + listel = TALLOC_ZERO_P(notify, struct notify_list); if (listel == NULL) { status = NT_STATUS_NO_MEMORY; goto done; diff --git a/source/smbd/ntquotas.c b/source/smbd/ntquotas.c index e754583312f..df851a2ca89 100644 --- a/source/smbd/ntquotas.c +++ b/source/smbd/ntquotas.c @@ -197,14 +197,14 @@ int vfs_get_user_ntquota_list(files_struct *fsp, SMB_NTQUOTA_LIST **qt_list) sid_string_static(&sid),fsp->conn->connectpath)); if ((tmp_list_ent=TALLOC_ZERO_P(mem_ctx,SMB_NTQUOTA_LIST))==NULL) { - DEBUG(0,("talloc_zero() failed\n")); + DEBUG(0,("TALLOC_ZERO() failed\n")); *qt_list = NULL; talloc_destroy(mem_ctx); return (-1); } if ((tmp_list_ent->quotas=TALLOC_ZERO_P(mem_ctx,SMB_NTQUOTA_STRUCT))==NULL) { - DEBUG(0,("talloc_zero() failed\n")); + DEBUG(0,("TALLOC_ZERO() failed\n")); *qt_list = NULL; talloc_destroy(mem_ctx); return (-1); @@ -231,7 +231,7 @@ void *init_quota_handle(TALLOC_CTX *mem_ctx) qt_handle = TALLOC_ZERO_P(mem_ctx,SMB_NTQUOTA_HANDLE); if (qt_handle==NULL) { - DEBUG(0,("talloc_zero() failed\n")); + DEBUG(0,("TALLOC_ZERO() failed\n")); return NULL; } diff --git a/source/smbd/nttrans.c b/source/smbd/nttrans.c index 35268f8962d..07f71125187 100644 --- a/source/smbd/nttrans.c +++ b/source/smbd/nttrans.c @@ -2358,7 +2358,7 @@ static int call_nt_transact_ioctl(connection_struct *conn, char *inbuf, char *ou shadow_data = TALLOC_ZERO_P(shadow_mem_ctx,SHADOW_COPY_DATA); if (shadow_data == NULL) { - DEBUG(0,("talloc_zero() failed!\n")); + DEBUG(0,("TALLOC_ZERO() failed!\n")); talloc_destroy(shadow_mem_ctx); return ERROR_NT(NT_STATUS_NO_MEMORY); } diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c index 89ae25caf7f..8591afe3c33 100644 --- a/source/smbd/trans2.c +++ b/source/smbd/trans2.c @@ -3465,7 +3465,7 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd } /* Copy the lock range data. */ - lock_data = (char *)talloc_memdup( + lock_data = (char *)TALLOC_MEMDUP( data_ctx, pdata, total_data); if (!lock_data) { talloc_destroy(data_ctx); diff --git a/source/smbd/vfs.c b/source/smbd/vfs.c index 0803ffb7e70..2fd448061e4 100644 --- a/source/smbd/vfs.c +++ b/source/smbd/vfs.c @@ -159,7 +159,7 @@ BOOL vfs_init_custom(connection_struct *conn, const char *vfs_object) handle = TALLOC_ZERO_P(conn->mem_ctx,vfs_handle_struct); if (!handle) { - DEBUG(0,("talloc_zero() failed!\n")); + DEBUG(0,("TALLOC_ZERO() failed!\n")); SAFE_FREE(module_name); return False; } |