#ifdef LDAP_SLAPI
struct berval bdn, ndn;
struct berval bsuffix, nsuffix;
+ int rc;
assert( dn != NULL );
assert( suffix != NULL );
bsuffix.bv_val = suffix;
bsuffix.bv_len = strlen( suffix );
- dnNormalize2( NULL, &bdn, &ndn );
- dnNormalize2( NULL, &bsuffix, &nsuffix );
+ if ( dnNormalize2( NULL, &bdn, &ndn ) != LDAP_SUCCESS ) {
+ return 0;
+ }
+
+ if ( dnNormalize2( NULL, &bsuffix, &nsuffix ) != LDAP_SUCCESS ) {
+ slapi_ch_free( (void **)&ndn.bv_val );
+ return 0;
+ }
- return dnIsSuffix( &ndn, &nsuffix );
+ rc = dnIsSuffix( &ndn, &nsuffix );
+
+ slapi_ch_free( (void **)&ndn.bv_val );
+ slapi_ch_free( (void **)&nsuffix.bv_val );
+
+ return rc;
#else /* LDAP_SLAPI */
return 0;
#endif /* LDAP_SLAPI */
rs.sr_ref = NULL;
rs.sr_ctrls = NULL;
+ slapi_pblock_get( pb, SLAPI_RESCONTROLS, &rs.sr_ctrls );
+
if ( err == LDAP_SASL_BIND_IN_PROGRESS ) {
slapi_pblock_get( pb, SLAPI_BIND_RET_SASLCREDS, (void *) &rs.sr_sasldata );
send_ldap_sasl( op, &rs );
return;
}
- rs.sr_type = REP_RESULT;
- slapi_pblock_get( pb, SLAPI_RESCONTROLS, &rs.sr_ctrls );
+ if (op->o_tag == LDAP_REQ_SEARCH)
+ rs.sr_nentries = nentries;
send_ldap_result( op, &rs );
#endif /* LDAP_SLAPI */
Modifications *slapi_x_ldapmods2modifications (LDAPMod **mods)
{
#ifdef LDAP_SLAPI
- Modifications *modlist, **modtail;
+ Modifications *modlist = NULL, **modtail;
LDAPMod **modp;
modtail = &modlist;