diff options
author | Jeremy Allison <jra@samba.org> | 2004-12-07 18:25:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:53:32 -0500 |
commit | acf9d61421faa6c0055d57fdee7db300dc5431aa (patch) | |
tree | 5482afecfe9b4a68b9a1f18d541a3109f8143ab7 /source3/nmbd/nmbd_namelistdb.c | |
parent | 3bd3be97dc8a581c0502410453091c195e322766 (diff) | |
download | samba-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/nmbd/nmbd_namelistdb.c')
-rw-r--r-- | source3/nmbd/nmbd_namelistdb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/nmbd/nmbd_namelistdb.c b/source3/nmbd/nmbd_namelistdb.c index bb14ff7641..bdb308a2ea 100644 --- a/source3/nmbd/nmbd_namelistdb.c +++ b/source3/nmbd/nmbd_namelistdb.c @@ -181,14 +181,14 @@ struct name_record *add_name_to_subnet( struct subnet_record *subrec, struct name_record *namerec; time_t time_now = time(NULL); - namerec = (struct name_record *)malloc( sizeof(*namerec) ); + namerec = SMB_MALLOC_P(struct name_record); if( NULL == namerec ) { DEBUG( 0, ( "add_name_to_subnet: malloc fail.\n" ) ); return( NULL ); } memset( (char *)namerec, '\0', sizeof(*namerec) ); - namerec->data.ip = (struct in_addr *)malloc( sizeof(struct in_addr) * num_ips ); + namerec->data.ip = SMB_MALLOC_ARRAY( struct in_addr, num_ips ); if( NULL == namerec->data.ip ) { DEBUG( 0, ( "add_name_to_subnet: malloc fail when creating ip_flgs.\n" ) ); ZERO_STRUCTP(namerec); @@ -329,7 +329,7 @@ void add_ip_to_name_record( struct name_record *namerec, struct in_addr new_ip ) if( find_ip_in_name_record( namerec, new_ip ) ) return; - new_list = (struct in_addr *)malloc( (namerec->data.num_ips + 1) * sizeof(struct in_addr) ); + new_list = SMB_MALLOC_ARRAY( struct in_addr, namerec->data.num_ips + 1); if( NULL == new_list ) { DEBUG(0,("add_ip_to_name_record: Malloc fail !\n")); return; @@ -460,7 +460,7 @@ void add_samba_names_to_subnet( struct subnet_record *subrec ) /* Create an IP list containing all our known subnets. */ num_ips = iface_count(); - iplist = (struct in_addr *)malloc( num_ips * sizeof(struct in_addr) ); + iplist = SMB_MALLOC_ARRAY( struct in_addr, num_ips); if( NULL == iplist ) { DEBUG(0,("add_samba_names_to_subnet: Malloc fail !\n")); return; |