- if ( op == NULL )
- return;
-
- if ( op->o_bd == NULL )
- return;
-
- ldap_pvt_thread_mutex_lock( &op->o_bd->be_pcl_mutex );
-
- LDAP_TAILQ_FOREACH( csne, &op->o_bd->be_pending_csn_list, csn_link ) {
- if ( csne->opid == op->o_opid && csne->connid == op->o_connid ) {
- LDAP_TAILQ_REMOVE( &op->o_bd->be_pending_csn_list, csne, csn_link );
- ch_free( csne->csn->bv_val );
- ch_free( csne->csn );
+ if ( op == NULL ) return;
+ if ( op->o_bd == NULL ) return;
+
+#if 0
+ /* it is NULL when we get here from the frontendDB;
+ * alternate fix: initialize frontendDB like all other backends */
+ assert( op->o_bd->be_pcl_mutexp != NULL );
+#endif
+
+ if ( op->o_bd->be_pcl_mutexp == NULL ) return;
+
+ ldap_pvt_thread_mutex_lock( op->o_bd->be_pcl_mutexp );
+
+ LDAP_TAILQ_FOREACH( csne, op->o_bd->be_pending_csn_list, ce_csn_link ) {
+ if ( csne->ce_opid == op->o_opid && csne->ce_connid == op->o_connid ) {
+ LDAP_TAILQ_REMOVE( op->o_bd->be_pending_csn_list,
+ csne, ce_csn_link );
+ if ( op->o_csn.bv_val == csne->ce_csn.bv_val ) {
+ BER_BVZERO( &op->o_csn );
+ }
+ ch_free( csne->ce_csn.bv_val );