Syntax *syn = slap_schema.si_ad_contextCSN->ad_type->sat_syntax;
#endif
- int rc, i, j;
+ int rc, i, j, changed = 0;
ber_len_t len;
slap_callback cb = { NULL };
if ( memcmp( syncCookie->ctxcsn[i].bv_val,
si->si_cookieState->cs_vals[j].bv_val, len ) > 0 ) {
mod.sml_values[j] = syncCookie->ctxcsn[i];
+ changed = 1;
if ( BER_BVISNULL( &first ) ) {
first = syncCookie->ctxcsn[i];
{
first = syncCookie->ctxcsn[i];
}
+ changed = 1;
}
}
/* Should never happen, ITS#5065 */
- if ( BER_BVISNULL( &first )) {
+ if ( BER_BVISNULL( &first ) || !changed ) {
ldap_pvt_thread_mutex_unlock( &si->si_cookieState->cs_mutex );
op->o_tmpfree( mod.sml_values, op->o_tmpmemctx );
return 0;