Suspicious dead code is found in source3/nmbd.c:1080. The code snippet is as following. 1080 if( False == register_my_workgroup_and_names() ) { 1081 kill_async_dns_child(); 1082 exit_daemon( "NMBD failed when creating my workgroup.", EACCES); 1083 } The return value of function "register_my_workgroup_and_names" is checked with "False". If it returns False, the code at lines 1081 and 1082 will be executed. However, according to the definition of function "register_my_workgroup_and_names" at source3/nmbd.c:114, there is only one return site, i.e. "return True" at line 205. Hence, the check at line 1080 will always take the false branch, and lines 1081 and 1082 will never be executed. Besides, I'm not sure whether it is just a dead code issue, or there are any implementation errors in function "register_my_workgroup_and_names"? Regards. shqking
Update... The suspicious dead code is found in source3/nmbd/nmbd_mynames.c:1080. Sorry for the writing mistakes.
Update again... The dead code is found in source3/nmbd/nmbd.c:1080. The definition of function "register_my_workgroup_and_names" is at source3/nmbd/nmbd_mynames.c:114. I feel terribly sorry for my mistake, and hope that it won't bring you much inconvenience. :)
Yes, this report is theoretically correct. Having said that, the better way to fix this is to change the code inside register_my_workgroup_and_names() to be able to correctly report back any malloc or other errors to the caller, rather then just (void)'ing out the returns as it does now. This code needs clean up to handle errors better, and was written a long time ago.