diff options
author | Andreas Schneider <asn@samba.org> | 2012-12-06 15:06:06 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2012-12-12 15:00:02 +0100 |
commit | 3bcd14c3970f3be58d8f0d802b905c64661173a6 (patch) | |
tree | 3bcc91e0eb57c6d90093aa895790f5f1f8a45d41 /source3 | |
parent | e5deaa29689ca53b5ba96836ff787281fdba06f1 (diff) | |
download | samba-3bcd14c3970f3be58d8f0d802b905c64661173a6.tar.gz samba-3bcd14c3970f3be58d8f0d802b905c64661173a6.tar.bz2 samba-3bcd14c3970f3be58d8f0d802b905c64661173a6.zip |
s3-nmbd: Cleanup code to make it more readable.
Found by Coverity.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/nmbd/nmbd_browsesync.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/nmbd/nmbd_browsesync.c b/source3/nmbd/nmbd_browsesync.c index b56baedf27..8bc28ad301 100644 --- a/source3/nmbd/nmbd_browsesync.c +++ b/source3/nmbd/nmbd_browsesync.c @@ -402,7 +402,6 @@ static void get_domain_master_name_node_status_success(struct subnet_record *sub struct res_rec *answers, struct in_addr from_ip) { - struct work_record *work; unstring server_name; server_name[0] = 0; @@ -443,6 +442,8 @@ static void get_domain_master_name_node_status_success(struct subnet_record *sub } if(!(nb_flags & NB_GROUP) && (name_type == 0x1b)) { + struct work_record *work; + if( DEBUGLVL( 5 ) ) { dbgtext( "get_domain_master_name_node_status_success:\n" ); dbgtext( "%s(%s) ", server_name, inet_ntoa(from_ip) ); @@ -455,13 +456,16 @@ static void get_domain_master_name_node_status_success(struct subnet_record *sub * to the workgroup list on the unicast_subnet. */ - if((work = find_workgroup_on_subnet( subrec, qname)) == NULL) { + work = find_workgroup_on_subnet( subrec, qname); + if (work == NULL) { struct nmb_name nmbname; /* * Add it - with an hour in the cache. */ - if(!(work= create_workgroup_on_subnet(subrec, qname, 60*60))) + work = create_workgroup_on_subnet(subrec, qname, 60*60); + if (work == NULL) { return; + } /* remember who the master is */ strlcpy(work->local_master_browser_name, |