summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_acct.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-12-07 18:25:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:32 -0500
commitacf9d61421faa6c0055d57fdee7db300dc5431aa (patch)
tree5482afecfe9b4a68b9a1f18d541a3109f8143ab7 /source3/nsswitch/winbindd_acct.c
parent3bd3be97dc8a581c0502410453091c195e322766 (diff)
downloadsamba-acf9d61421faa6c0055d57fdee7db300dc5431aa.tar.gz
samba-acf9d61421faa6c0055d57fdee7db300dc5431aa.tar.bz2
samba-acf9d61421faa6c0055d57fdee7db300dc5431aa.zip
r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy. (This used to be commit 620f2e608f70ba92f032720c031283d295c5c06a)
Diffstat (limited to 'source3/nsswitch/winbindd_acct.c')
-rw-r--r--source3/nsswitch/winbindd_acct.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/nsswitch/winbindd_acct.c b/source3/nsswitch/winbindd_acct.c
index e6496695cb..2c8b7cae28 100644
--- a/source3/nsswitch/winbindd_acct.c
+++ b/source3/nsswitch/winbindd_acct.c
@@ -219,7 +219,7 @@ static WINBINDD_GR* string2group( char *string )
if ( num_gr_members ) {
fstring buffer;
- gr_members = (char**)smb_xmalloc(sizeof(char*)*(num_gr_members+1));
+ gr_members = SMB_XMALLOC_ARRAY(char*, num_gr_members+1);
i = 0;
while ( next_token(&str, buffer, ",", sizeof(buffer)) && i<num_gr_members ) {
@@ -284,7 +284,7 @@ static char* group2string( const WINBINDD_GR *grp )
member = grp->gr_mem[num_members];
}
- gr_mem_str = smb_xmalloc(size);
+ gr_mem_str = SMB_XMALLOC_ARRAY(char, size);
for ( i=0; i<num_members; i++ ) {
snprintf( &gr_mem_str[idx], size-idx, "%s,", grp->gr_mem[i] );
@@ -295,7 +295,7 @@ static char* group2string( const WINBINDD_GR *grp )
}
else {
/* no members */
- gr_mem_str = smb_xmalloc(sizeof(fstring));
+ gr_mem_str = SMB_XMALLOC_ARRAY(char, sizeof(fstring));
fstrcpy( gr_mem_str, "" );
}
@@ -639,7 +639,7 @@ static BOOL wb_addgrpmember( WINBINDD_GR *grp, const char *user )
}
/* add one new slot and keep an extra for the terminating NULL */
- members = Realloc( grp->gr_mem, (grp->num_gr_mem+2)*sizeof(char*) );
+ members = SMB_REALLOC_ARRAY( grp->gr_mem, char *, grp->num_gr_mem+2);
if ( !members )
return False;