From: Howard Chu Date: Wed, 14 Jan 2015 10:46:04 +0000 (+0000) Subject: Minor cleanup (coverity) X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0e5f63ae6dd7b763a1df7cae5935eba8779d0bfe;p=openldap Minor cleanup (coverity) --- diff --git a/servers/slapd/overlays/constraint.c b/servers/slapd/overlays/constraint.c index 096f32aa79..33323e399d 100644 --- a/servers/slapd/overlays/constraint.c +++ b/servers/slapd/overlays/constraint.c @@ -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; } diff --git a/servers/slapd/overlays/pcache.c b/servers/slapd/overlays/pcache.c index 291dddf0f2..20f1558abf 100644 --- a/servers/slapd/overlays/pcache.c +++ b/servers/slapd/overlays/pcache.c @@ -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; diff --git a/servers/slapd/overlays/rwmmap.c b/servers/slapd/overlays/rwmmap.c index 4594353c98..8f6ce66dbe 100644 --- a/servers/slapd/overlays/rwmmap.c +++ b/servers/slapd/overlays/rwmmap.c @@ -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 */ diff --git a/servers/slapd/overlays/translucent.c b/servers/slapd/overlays/translucent.c index a8846b10a1..b7de2cb3be 100644 --- a/servers/slapd/overlays/translucent.c +++ b/servers/slapd/overlays/translucent.c @@ -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",