MatchingRuleAssertion *mra )
{
Attribute *a;
+ void *memctx = op ? op->o_tmpmemctx : NULL;
if ( mra->ma_desc ) {
/*
/* If ma_rule is not the same as the attribute's
* normal rule, then we can't use the a_nvals.
*/
- if (mra->ma_rule == a->a_desc->ad_type->sat_equality)
+ if (mra->ma_rule == a->a_desc->ad_type->sat_equality) {
bv = a->a_nvals;
- else
+ } else {
bv = a->a_vals;
- for ( ; bv->bv_val != NULL; bv++ )
- {
+ }
+
+ for ( ; bv->bv_val != NULL; bv++ ) {
int ret;
int rc;
const char *text;
/* normalize for equality */
rc = asserted_value_validate_normalize( a->a_desc, mra->ma_rule,
SLAP_MR_EXT|SLAP_MR_VALUE_OF_ASSERTION_SYNTAX,
- &mra->ma_value, &value, &text, op->o_tmpmemctx );
+ &mra->ma_value, &value, &text, memctx );
if ( rc != LDAP_SUCCESS ) {
continue;
}
int rc;
/* parse and pretty the dn */
- rc = dnPrettyDN( NULL, &e->e_name, &dn, op->o_tmpmemctx );
+ rc = dnPrettyDN( NULL, &e->e_name, &dn, memctx );
if ( rc != LDAP_SUCCESS ) {
return LDAP_INVALID_SYNTAX;
}
rc = asserted_value_validate_normalize( ad,
mra->ma_rule,
SLAP_MR_EXT|SLAP_MR_VALUE_OF_ASSERTION_SYNTAX,
- &mra->ma_value, &value, &text, op->o_tmpmemctx );
+ &mra->ma_value, &value, &text, memctx );
if ( rc != LDAP_SUCCESS ) {
continue;
}
bv, &value, &text );
if( rc != LDAP_SUCCESS ) {
- ldap_dnfree_x( dn, op->o_tmpmemctx );
+ ldap_dnfree_x( dn, memctx );
return rc;
}
if ( ret == 0 ) {
- ldap_dnfree_x( dn, op->o_tmpmemctx );
+ ldap_dnfree_x( dn, memctx );
return LDAP_COMPARE_TRUE;
}
}
}
if ( ava->aa_desc == slap_schema.si_ad_hasSubordinates
- && op->o_bd && op->o_bd->be_has_subordinates ) {
+ && op && op->o_bd && op->o_bd->be_has_subordinates ) {
int hasSubordinates;
struct berval hs;
}
if ( hasSubordinates == LDAP_COMPARE_TRUE ) {
- hs.bv_val = "TRUE";
- hs.bv_len = sizeof( "TRUE" ) - 1;
+ hs = slap_true_bv;
} else if ( hasSubordinates == LDAP_COMPARE_FALSE ) {
- hs.bv_val = "FALSE";
- hs.bv_len = sizeof( "FALSE" ) - 1;
+ hs = slap_false_bv;
} else {
return LDAP_OTHER;
* is boolean-valued; I think we may live with this
* simplification by now
*/
- if ( op->o_bd && op->o_bd->be_has_subordinates ) {
+ if ( op && op->o_bd && op->o_bd->be_has_subordinates ) {
return LDAP_COMPARE_TRUE;
}