浏览代码

610281 - fix coverity Defect Type: Control flow issues

https://bugzilla.redhat.com/show_bug.cgi?id=610281

11795 DEADCODE Triaged Unassigned Bug Minor Fix Required
DS_LASRoleDnAttrEval() ds/ldap/servers/plugins/acl/acllas.c

Comment:
Merged the 2 lines to check matched with ACL_TRUE into one.
Noriko Hosoi 15 年之前
父节点
当前提交
782432e0ea
共有 1 个文件被更改,包括 3 次插入9 次删除
  1. 3 9
      ldap/servers/plugins/acl/acllas.c

+ 3 - 9
ldap/servers/plugins/acl/acllas.c

@@ -3920,16 +3920,10 @@ DS_LASRoleDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
 			** Let's compare with the client, thi might be just an user. If it is not
 			** Let's compare with the client, thi might be just an user. If it is not
 			** then we test it against the list of groups.
 			** then we test it against the list of groups.
 			*/
 			*/
-			if ((matched = acllas__user_has_role(
-									lasinfo.aclpb,	      						
-				      				roleDN, 
-				      	lasinfo.aclpb->aclpb_authorization_sdn)) == ACL_TRUE){
-				slapi_ch_free ( (void **)&n_attrval );
-				slapi_sdn_free(&roleDN );
-				break;
-			}			
+			matched = acllas__user_has_role(lasinfo.aclpb,
+							roleDN, lasinfo.aclpb->aclpb_authorization_sdn);
 			slapi_ch_free ( (void **)&n_attrval );
 			slapi_ch_free ( (void **)&n_attrval );
-			slapi_sdn_free(&roleDN );
+			slapi_sdn_free(&roleDN);
 			if (matched == ACL_TRUE) {
 			if (matched == ACL_TRUE) {
 				break;
 				break;
 			} else if ( matched == ACL_DONT_KNOW ) {
 			} else if ( matched == ACL_DONT_KNOW ) {