/* 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;
}
filter_free( filter );
}
+ while ( dlm != NULL ) {
+ dlml = dlm;
+ dlm = dlm->dlm_next;
+ ch_free( dlml );
+ }
+
Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
c->log, c->cr_msg, 0 );
c->argv[ attridx ] );
Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
c->log, c->cr_msg, 0 );
- return 1;
+ rc = 1;
+ goto done_uri;
}
if ( !is_at_subtype( ad->ad_type, slap_schema.si_ad_labeledURI->ad_type ) ) {
c->argv[ attridx ] );
Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
c->log, c->cr_msg, 0 );
- return 1;
+ rc = 1;
+ goto done_uri;
}
attridx++;
i - 3, c->argv[ i ] );
Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
c->log, c->cr_msg, 0 );
- return 1;
+ rc = 1;
+ goto done_uri;
}
arg = cp + 1;
}
i - 3, c->argv[ i ] );
Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
c->log, c->cr_msg, 0 );
- return 1;
+ rc = 1;
+ goto done_uri;
}
dlmp = (dynlist_map_t *)ch_calloc( 1, sizeof( dynlist_map_t ) );
c->valx );
Debug( LDAP_DEBUG_ANY, "%s: %s.\n",
c->log, c->cr_msg, 0 );
- return 1;
+ rc = 1;
+ goto done_uri;
}
dlip = &(*dlip)->dli_next;
}
*t1++ = *p1++;
p2 = strchr( p1, '=' );
- if ( !p2 )
+ if ( !p2 ) {
+ if ( !descs ) {
+ ch_free( temp2 );
+ return -1;
+ }
break;
+ }
i = p2 - p1;
AC_MEMCPY( t1, p1, i );
t1 += i;
ad = NULL;
i = slap_bv2ad( &bv, &ad, text );
if ( i ) {
+ ch_free( temp2 );
ch_free( descs );
return -1;
}
}
if ( !t_cnt ) {
*text = "couldn't parse template";
+ ch_free(attrs);
return -1;
}
if ( !got_oc && !( set->flags & PC_GOT_OC )) {
BerElement *ber = (BerElement *) &berbuf, *b2 = (BerElement *) &bb2;
LDAPControl c = { 0 }, *cp;
struct berval bv;
+ int rc;
BER_BVZERO( &c.ldctl_value );
if ( exptime >= 0 ) {
ber_init2( b2, NULL, LBER_USE_DER );
ber_printf( b2, "ti", PPOLICY_EXPIRE, exptime );
- ber_flatten2( b2, &bv, 1 );
+ rc = ber_flatten2( b2, &bv, 1 );
(void)ber_free_buf(b2);
+ if (rc == -1) {
+ cp = NULL;
+ goto fail;
+ }
ber_printf( ber, "tO", PPOLICY_WARNING, &bv );
ch_free( bv.bv_val );
} else if ( grace > 0 ) {
ber_init2( b2, NULL, LBER_USE_DER );
ber_printf( b2, "ti", PPOLICY_GRACE, grace );
- ber_flatten2( b2, &bv, 1 );
+ rc = ber_flatten2( b2, &bv, 1 );
(void)ber_free_buf(b2);
+ if (rc == -1) {
+ cp = NULL;
+ goto fail;
+ }
ber_printf( ber, "tO", PPOLICY_WARNING, &bv );
ch_free( bv.bv_val );
}
cp->ldctl_value.bv_val = (char *)&cp[1];
cp->ldctl_value.bv_len = c.ldctl_value.bv_len;
AC_MEMCPY( cp->ldctl_value.bv_val, c.ldctl_value.bv_val, c.ldctl_value.bv_len );
+fail:
(void)ber_free_buf(ber);
return cp;
return LDAP_NO_MEMORY;
}
- for ( i = 0, j = 0; !BER_BVISNULL( &an[i].an_name ); i++ ) {
+ j = 0;
+ if ( an != NULL ) {
+ for ( i = 0; !BER_BVISNULL( &an[i].an_name ); i++ ) {
struct ldapmapping *m;
int at_drop_missing = 0,
oc_drop_missing = 0;
}
}
}
+ }
if ( op->o_bd->be_extra_anlist != NULL ) {
/* we assume be_extra_anlist are already mapped */
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:
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",