r22542: Move over to using the _strict varients of the talloc
authorJeremy Allison <jra@samba.org>
Fri, 27 Apr 2007 23:18:41 +0000 (23:18 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:19:44 +0000 (12:19 -0500)
calls. No functional changes. Looks bigger than it is :-).
Jeremy.
(This used to be commit f6fa3080fee1b20df9f1968500840a88cf0ee592)

39 files changed:
source3/auth/auth_util.c
source3/include/smb_macros.h
source3/lib/data_blob.c
source3/lib/launchd.c
source3/libaddns/dns.h
source3/libmsrpc/cac_samr.c
source3/libmsrpc/cac_winreg.c
source3/libmsrpc/libmsrpc_internal.c
source3/libsmb/cliquota.c
source3/locking/locking.c
source3/modules/nfs4_acls.c
source3/modules/vfs_aixacl2.c
source3/modules/vfs_gpfs.c
source3/nsswitch/idmap.c
source3/nsswitch/idmap_ad.c
source3/nsswitch/idmap_ldap.c
source3/nsswitch/idmap_rid.c
source3/nsswitch/idmap_tdb.c
source3/nsswitch/winbindd_async.c
source3/printing/notify.c
source3/python/py_ntsec.c
source3/rpc_parse/parse_buffer.c
source3/rpc_parse/parse_eventlog.c
source3/rpc_parse/parse_misc.c
source3/rpc_parse/parse_net.c
source3/rpc_parse/parse_prs.c
source3/rpc_server/srv_echo_nt.c
source3/rpc_server/srv_samr_nt.c
source3/rpc_server/srv_spoolss_nt.c
source3/rpc_server/srv_srvsvc_nt.c
source3/smbd/conn.c
source3/smbd/fake_file.c
source3/smbd/notify_inotify.c
source3/smbd/notify_internal.c
source3/smbd/ntquotas.c
source3/smbd/nttrans.c
source3/smbd/password.c
source3/smbd/trans2.c
source3/smbd/vfs.c

index 336daa906d0e81cad662487b0ded50a23fe09b8a..e2bc8e75b5e250be321ddf9673ad1a8d6452e236 100644 (file)
@@ -834,9 +834,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;
                }
@@ -864,9 +864,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;
                }
@@ -1117,7 +1117,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;
index 4a49ef3ed4fe47aa2280b2fe345afec7f3ee9f20..f93ed912ee01a9a083d822556109d041f509ef3a 100644 (file)
@@ -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 */
index c7eadc1acfb9a32b33578fde781a859b9d0dce6a..e07247bc49ef7fae0fbfb49f8f37cbc8d4a49aa5 100644 (file)
@@ -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)
index 1fd5a33db000327840842493a532f330a4721585..2c3f7cac89fdeb0cd8380ca41c64575ea742d912 100644 (file)
@@ -138,7 +138,7 @@ static void pull_launch_sockets(launch_data_t key,
                            count, launch_data_dict_get_count(item)));
                }
 
-               linfo->socket_list = talloc_array(NULL, int, count);
+               linfo->socket_list = TALLOC_ARRAY(NULL, int, count);
                if (linfo->socket_list == NULL) {
                        goto done;
                }
@@ -200,7 +200,7 @@ done:
                                        linfo->num_sockets));
 
                count = linfo->num_sockets;
-               linfo->socket_list = talloc_array(NULL, int, count);
+               linfo->socket_list = TALLOC_ARRAY(NULL, int, count);
                if (linfo->socket_list == NULL) {
                        goto done;
                }
index 6f480a546957ecc432a5ca54462cf7d0654a51f1..bbc4b68656fb29b6a6bf5ccba22a2b93134f9760 100644 (file)
 
 #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)
index e85142af906ec0aa7da09e1b1e6546b2ce135a8e..e50fb474f51ca99d27ab2bccab034cd6e26d85a4 100644 (file)
@@ -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 );
index 74156be63fd931bb29128c3e62fd20a78371cf2d..ee9d16aa64f1df2f564e48ff371c40a563ca41e6 100644 (file)
@@ -775,14 +775,14 @@ int cac_RegEnumValues( CacServerHandle * hnd, TALLOC_CTX * mem_ctx,
        }
 
        /*we need to assume that the max number of values will be enumerated */
-       types_out = talloc_array( mem_ctx, uint32, op->in.max_values );
+       types_out = TALLOC_ARRAY( mem_ctx, uint32, 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 *, 
+       values_out = TALLOC_ARRAY( mem_ctx, REG_VALUE_DATA *, 
                                   op->in.max_values );
 
        if ( !values_out ) {
@@ -791,7 +791,7 @@ int cac_RegEnumValues( CacServerHandle * hnd, TALLOC_CTX * mem_ctx,
                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 );
index b9eb5a40e9373cd301ca2fdc21921ed186ded2a8..a86cde178d6e83cf9c399e021d9c48a152bbb20b 100644 (file)
@@ -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;
index 5627d28bb5d455a7024915f0e44356217c00b946..2a47ae246328fe4b8eb6b79699dbbe1803af24b6 100644 (file)
@@ -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;
                        }
index dc1d6071559ca1d3dc332d6c8f9898c938e61c0b..c548d6eecb09d17a0dca46ed3b2b92b1a1052ee8 100644 (file)
@@ -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));
 
index dd4524085792413dc9c02642c02657216d585ebf..b6bcc8cd47fb99ac15d152365b2a4d50cd67b0ba 100644 (file)
@@ -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"));
index 62a517a6e0808bf8228d786c00f54b15a736e76a..f1e116ec197e1d525c03aeec01b849c4d9e562b6 100644 (file)
@@ -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;
        }
index 6841300d5b30b23acf4c1f61584b32d6e65e891c..932b5000c8321e671b977b8b3c05618645e16c75 100644 (file)
@@ -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;
index 7589ee66abd984bf29840d913f93f3527e3b78b0..26fcc692e9e95a5976e0d41449fdf724c906e326 100644 (file)
@@ -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);
index e15e4b90fb8f7d71a2dd86968048620fa6e9bdf5..d3fd9e1c8aaf214c7be6eada718bc5f2030b8836 100644 (file)
@@ -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;
        }
index 7575416af5e3a631d2fc8ee7eaacc369d2f9f626..2fb9a17d3f51635b8f1f8b3828350ddca18dbddf 100644 (file)
@@ -216,7 +216,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 */
@@ -736,7 +736,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;
index 8e016879b8c9e170278d8161fae8c4158cbd7a0a..1daf511ddaea2db71393bb525bb7e9ac9a0e8889 100644 (file)
@@ -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;
        }
index 4eb47c42b84fb3ea11a26e3f5cd8dbe9155744f6..2961229e4911ed66d3db7cfcdc59f1970c0eeb9f 100644 (file)
@@ -1176,7 +1176,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;
index aa48f513e9774af01d5121e799266cd088f81c5f..a8a92c3caead17b9dcbf370b22b7735d40f35bf0 100644 (file)
@@ -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);
index 2db8768395db80b569a9d174ef82c8c50371f4e8..e2aed5ce252c608df9d95bd4781052554b5586c4 100644 (file)
@@ -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;
                }
        }
index e59a33f97bea2805bf57412a1e7e65f08d96921c..f82433a69ff819f7a6a72ea1f2a1bc78cde9a4e9 100644 (file)
@@ -157,7 +157,7 @@ BOOL py_to_ACL(SEC_ACL *acl, PyObject *dict, TALLOC_CTX *mem_ctx)
        
        acl->num_aces = PyList_Size(obj);
 
-       acl->aces = talloc_array(mem_ctx, struct security_ace, acl->num_aces);
+       acl->aces = TALLOC_ARRAY(mem_ctx, struct security_ace, acl->num_aces);
        acl->size = SEC_ACL_HEADER_SIZE;
 
        for (i = 0; i < acl->num_aces; i++) {
index 5643189afeaf018017dad1f5484cab7e5b9c31c1..b66eb9910a898b34631273281cc5f3c75e690843 100644 (file)
@@ -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);
                }
 
index addf433feb8c7e9b0c0d5e645c912471d1c83871..436f35aff6a770958342deaa3bbedfb489578f21 100644 (file)
@@ -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,
index efc5274f45ede7b6a05194dc461453d8612fe685..a42915aa08fdc2ee1eef2b74058081b4ba62d923 100644 (file)
@@ -221,7 +221,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;
index 3eb31ad55fe580b91df68ce9d741021914930fc7..b3331c8369f536ed181a14feef59eef31fb58e88 100644 (file)
@@ -2995,7 +2995,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]))
@@ -3004,8 +3013,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))
index 172195f8237259df44f71c9d461cd06bc72c12c1..bf79c443953c6b6fe652387ef5a90fc5a8bb2a86 100644 (file)
@@ -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;
@@ -1825,7 +1825,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) );
index eb095f6bfeffec0d18a60c46e8e16274d27c5f3d..58ab51e2b006866df17e76aeb6e93dd222f335bd 100644 (file)
@@ -120,7 +120,7 @@ void _echo_TestEnum(pipes_struct *p, struct echo_TestEnum *r)
 void _echo_TestSurrounding(pipes_struct *p, struct echo_TestSurrounding *r)
 {
        r->out.data->x *= 2;
-       r->out.data->surrounding = talloc_zero_array(p->mem_ctx, uint16_t, r->in.data->x);
+       r->out.data->surrounding = TALLOC_ZERO_ARRAY(p->mem_ctx, uint16_t, r->in.data->x);
 }
 
 uint16 _echo_TestDoublePointer(pipes_struct *p, struct echo_TestDoublePointer *r)
index a128757ad0a39a85a6b07d1d84632a5617a2260a..80b1b93a506a15c48040be7f63687c3963f474c2 100644 (file)
@@ -854,7 +854,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;
        }
 
index 3e1c1a240865e215e5f4d76074e2bb1fa5c396b9..beb3b5aef0d2a5da7f7959d5c8b17ee1cdb09d7f 100644 (file)
@@ -9504,7 +9504,7 @@ WERROR _spoolss_enumprinterdataex(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATAEX *q_
                if ( data_len ) {
                        if ( !(enum_values[i].data = (uint8 *)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;
index 615f5e1b073b58ffeedc7f8557bc0ed23fa7c06f..8f68bf36a1c291d486c99e234132867c97252c34 100644 (file)
@@ -544,61 +544,61 @@ static WERROR init_srv_share_info_ctr(pipes_struct *p,
 
        switch (info_level) {
        case 0:
-               if (!(ctr->ctr0 = talloc_zero(
+               if (!(ctr->ctr0 = TALLOC_ZERO_P(
                              p->mem_ctx, struct srvsvc_NetShareCtr0))) {
                        goto done;
                }
                break;
        case 1:
-               if (!(ctr->ctr1 = talloc_zero(
+               if (!(ctr->ctr1 = TALLOC_ZERO_P(
                              p->mem_ctx, struct srvsvc_NetShareCtr1))) {
                        goto done;
                }
                break;
        case 2:
-               if (!(ctr->ctr2 = talloc_zero(
+               if (!(ctr->ctr2 = TALLOC_ZERO_P(
                              p->mem_ctx, struct srvsvc_NetShareCtr2))) {
                        goto done;
                }
                break;
        case 501:
-               if (!(ctr->ctr501 = talloc_zero(
+               if (!(ctr->ctr501 = TALLOC_ZERO_P(
                              p->mem_ctx, struct srvsvc_NetShareCtr501))) {
                        goto done;
                }
                break;
        case 502:
-               if (!(ctr->ctr502 = talloc_zero(
+               if (!(ctr->ctr502 = TALLOC_ZERO_P(
                              p->mem_ctx, struct srvsvc_NetShareCtr502))) {
                        goto done;
                }
                break;
        case 1004:
-               if (!(ctr->ctr1004 = talloc_zero(
+               if (!(ctr->ctr1004 = TALLOC_ZERO_P(
                              p->mem_ctx, struct srvsvc_NetShareCtr1004))) {
                        goto done;
                }
                break;
        case 1005:
-               if (!(ctr->ctr1005 = talloc_zero(
+               if (!(ctr->ctr1005 = TALLOC_ZERO_P(
                              p->mem_ctx, struct srvsvc_NetShareCtr1005))) {
                        goto done;
                }
                break;
        case 1006:
-               if (!(ctr->ctr1006 = talloc_zero(
+               if (!(ctr->ctr1006 = TALLOC_ZERO_P(
                              p->mem_ctx, struct srvsvc_NetShareCtr1006))) {
                        goto done;
                }
                break;
        case 1007:
-               if (!(ctr->ctr1007 = talloc_zero(
+               if (!(ctr->ctr1007 = TALLOC_ZERO_P(
                              p->mem_ctx, struct srvsvc_NetShareCtr1007))) {
                        goto done;
                }
                break;
        case 1501:
-               if (!(ctr->ctr1501 = talloc_zero(
+               if (!(ctr->ctr1501 = TALLOC_ZERO_P(
                              p->mem_ctx, struct srvsvc_NetShareCtr1501))) {
                        goto done;
                }
@@ -781,7 +781,7 @@ static void init_srv_sess_info_0(pipes_struct *p, struct srvsvc_NetSessCtr0 *ss0
 
        DEBUG(5,("init_srv_sess_0_ss0\n"));
 
-       ss0->array = talloc_array(p->mem_ctx, struct srvsvc_NetSessInfo0, *stot);
+       ss0->array = TALLOC_ARRAY(p->mem_ctx, struct srvsvc_NetSessInfo0, *stot);
 
        if (snum) {
                for (; (*snum) < (*stot); (*snum)++) {
@@ -861,7 +861,7 @@ static void init_srv_sess_info_1(pipes_struct *p, struct srvsvc_NetSessCtr1 *ss1
 
        (*stot) = list_sessions(&session_list);
 
-       ss1->array = talloc_array(p->mem_ctx, struct srvsvc_NetSessInfo1, *stot);
+       ss1->array = TALLOC_ARRAY(p->mem_ctx, struct srvsvc_NetSessInfo1, *stot);
        
        for (; (*snum) < (*stot); (*snum)++) {
                uint32 num_files;
@@ -954,7 +954,7 @@ static void init_srv_conn_info_0(pipes_struct *p, struct srvsvc_NetConnCtr0 *ss0
        DEBUG(5,("init_srv_conn_0_ss0\n"));
 
        if (snum) {
-               ss0->array = talloc_array(p->mem_ctx, struct srvsvc_NetConnInfo0, *stot);
+               ss0->array = TALLOC_ARRAY(p->mem_ctx, struct srvsvc_NetConnInfo0, *stot);
                for (; (*snum) < (*stot); (*snum)++) {
 
                        ss0->array[num_entries].conn_id = (*stot);
@@ -996,7 +996,7 @@ static void init_srv_conn_info_1(pipes_struct *p, struct srvsvc_NetConnCtr1 *ss1
        DEBUG(5,("init_srv_conn_1_ss1\n"));
 
        if (snum) {
-               ss1->array = talloc_array(p->mem_ctx, struct srvsvc_NetConnInfo1, *stot);
+               ss1->array = TALLOC_ARRAY(p->mem_ctx, struct srvsvc_NetConnInfo1, *stot);
                for (; (*snum) < (*stot); (*snum)++) {
                        ss1->array[num_entries].conn_id = (*stot);
                        ss1->array[num_entries].conn_type = 0x3;
@@ -1067,7 +1067,7 @@ static WERROR net_file_enum_3(pipes_struct *p, union srvsvc_NetFileCtr *ctr, uin
           (b) active pipes
           (c) open directories and files */
 
-       ctr->ctr3 = talloc_zero(p->mem_ctx, struct srvsvc_NetFileCtr3);
+       ctr->ctr3 = TALLOC_ZERO_P(p->mem_ctx, struct srvsvc_NetFileCtr3);
        
        status = net_enum_files( ctx, &ctr->ctr3->array, num_entries, resume_hnd );
        if ( !W_ERROR_IS_OK(status))
@@ -1121,7 +1121,7 @@ WERROR _srvsvc_NetSrvGetInfo(pipes_struct *p, struct srvsvc_NetSrvGetInfo *r)
                   here, as most of it is made up. */
 
        case 102:
-               r->out.info->info102 = talloc_zero(p->mem_ctx, struct srvsvc_NetSrvInfo102);
+               r->out.info->info102 = TALLOC_ZERO_P(p->mem_ctx, struct srvsvc_NetSrvInfo102);
 
                r->out.info->info102->platform_id = 500;
                r->out.info->info102->version_major = lp_major_announce_version();
@@ -1138,7 +1138,7 @@ WERROR _srvsvc_NetSrvGetInfo(pipes_struct *p, struct srvsvc_NetSrvGetInfo *r)
                r->out.info->info102->comment = lp_serverstring();
                break;
        case 101:
-               r->out.info->info101 = talloc_zero(p->mem_ctx, struct srvsvc_NetSrvInfo101);
+               r->out.info->info101 = TALLOC_ZERO_P(p->mem_ctx, struct srvsvc_NetSrvInfo101);
                        r->out.info->info101->platform_id = 500;
                        r->out.info->info101->server_name = global_myname();
                        r->out.info->info101->version_major = lp_major_announce_version();
@@ -1147,7 +1147,7 @@ WERROR _srvsvc_NetSrvGetInfo(pipes_struct *p, struct srvsvc_NetSrvGetInfo *r)
                        r->out.info->info101->comment = lp_serverstring();
                break;
        case 100:
-               r->out.info->info100 = talloc_zero(p->mem_ctx, struct srvsvc_NetSrvInfo100);
+               r->out.info->info100 = TALLOC_ZERO_P(p->mem_ctx, struct srvsvc_NetSrvInfo100);
                r->out.info->info100->platform_id = 500;
                r->out.info->info100->server_name = global_myname();
                break;
index 388cd004f989d3477c95bf69119389c6a7753d35..a15684a35ba253b25adebed125e55d97a84e4d1f 100644 (file)
@@ -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;
        }
index 208b3256673bfafda859c951ec2f8f98301e4834..5333742ba81c92414f5295ae909c4565ffa5e3d6 100644 (file)
@@ -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;
                        }
index ff17d455f39e6923024ca7080adabeae45b2ebcd..1b1bad7e966896e44b2cc85cbdba862f3799133d 100644 (file)
@@ -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) {
index e1f47540e53b9fb1acdc0d9e543a0aa62da75498..9f23db667113ed680f08eea30248758110ce70a9 100644 (file)
@@ -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;
index e754583312f6d73a41ab354cb2825243941ac508..df851a2ca89f1f846ca934018aef0895b77fbc42 100644 (file)
@@ -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;
        }
 
index 1a4b43ce51f3010fc6e8cbecca3071a98719c5e3..eb4a6cd969b5a3c143a36057ef8b0fb4794751a6 100644 (file)
@@ -2367,7 +2367,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);
                }
index b7945bd7eacad8aba6f232b4532a61bb50de9973..ce03e6d85f17f7091b1a37feca3d75e76b2ba4dc 100644 (file)
@@ -156,7 +156,7 @@ int register_vuid(auth_serversupplied_info *server_info,
                return UID_FIELD_INVALID;
        }
 
-       if((vuser = talloc_zero(NULL, user_struct)) == NULL) {
+       if((vuser = TALLOC_ZERO_P(NULL, user_struct)) == NULL) {
                DEBUG(0,("Failed to talloc users struct!\n"));
                data_blob_free(&session_key);
                return UID_FIELD_INVALID;
index 512b3162fadf4fd975d7d98fee5a9f2dfda365b9..91218fe9f48ee7223fd36716107de28da2285085 100644 (file)
@@ -3517,7 +3517,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);
index 0803ffb7e7017a210e187b507bab8e77555c8c13..2fd448061e4d81dac2c1b2acd4858e64ca900810 100644 (file)
@@ -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;
        }