- ldap_pvt_thread_mutex_lock( &conn->c_mutex );
- LDAP_STAILQ_FOREACH( op, &conn->c_pending_ops, o_next ) {
- if ( op->o_msgid == opid ) {
- LDAP_STAILQ_REMOVE( &conn->c_pending_ops, op, slap_op, o_next );
- slap_op_free( op );
+ ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
+ LDAP_STAILQ_FOREACH( o, &op->o_conn->c_pending_ops, o_next ) {
+ if ( o->o_msgid == opid ) {
+ LDAP_STAILQ_REMOVE( &op->o_conn->c_pending_ops, o, slap_op, o_next );
+ slap_op_free( o );