Minor cleanup (coverity)

This commit is contained in:
Howard Chu 2015-01-14 10:46:04 +00:00
parent 651804842f
commit 0e5f63ae6d
4 changed files with 8 additions and 13 deletions

View File

@ -980,16 +980,6 @@ constraint_update( Operation *op, SlapReply *rs )
/* Do we need to count attributes? */
for(cp = c; cp; cp = cp->ap_next) {
if (cp->type == CONSTRAINT_COUNT) {
if (rc != 0 || target_entry == NULL) {
Debug(LDAP_DEBUG_TRACE,
"==> constraint_update rc = %d DN=\"%s\"%s\n",
rc, op->o_req_ndn.bv_val,
target_entry ? "" : " not found" );
if ( rc == 0 )
rc = LDAP_CONSTRAINT_VIOLATION;
goto mod_violation;
}
if (cp->restrict_lud && constraint_check_restrict(op, cp, target_entry) == 0) {
continue;
}

View File

@ -455,8 +455,11 @@ ftemp_attrs( struct berval *ftemp, struct berval *template,
*t1++ = *p1++;
p2 = strchr( p1, '=' );
if ( !p2 )
if ( !p2 ) {
if ( !descs )
return -1;
break;
}
i = p2 - p1;
AC_MEMCPY( t1, p1, i );
t1 += i;

View File

@ -215,6 +215,7 @@ rwm_map_attrnames(
return LDAP_NO_MEMORY;
}
if ( an != NULL ) {
for ( i = 0, j = 0; !BER_BVISNULL( &an[i].an_name ); i++ ) {
struct ldapmapping *m;
int at_drop_missing = 0,
@ -331,6 +332,7 @@ rwm_map_attrnames(
}
}
}
}
if ( op->o_bd->be_extra_anlist != NULL ) {
/* we assume be_extra_anlist are already mapped */

View File

@ -420,12 +420,12 @@ static int translucent_modify(Operation *op, SlapReply *rs) {
op->o_bd = &ov->db;
ov->db.be_acl = op->o_bd->be_acl;
rc = ov->db.bd_info->bi_entry_get_rw(op, &op->o_req_ndn, NULL, NULL, 0, &re);
op->o_bd = db;
if(rc != LDAP_SUCCESS || re == NULL ) {
send_ldap_error((op), rs, LDAP_NO_SUCH_OBJECT,
"attempt to modify nonexistent local record");
return(rs->sr_err);
}
op->o_bd = db;
/*
** fetch entry from local backend;
** if it exists:
@ -788,7 +788,7 @@ static int translucent_search_cb(Operation *op, SlapReply *rs) {
if ( rs->sr_type == REP_RESULT && ( tc->step & USE_LIST ))
return 0;
if(!op || !rs || rs->sr_type != REP_SEARCH || !rs->sr_entry)
if(rs->sr_type != REP_SEARCH || !rs->sr_entry)
return(SLAP_CB_CONTINUE);
Debug(LDAP_DEBUG_TRACE, "==> translucent_search_cb: %s\n",