+ {
+ GroupAssertion *g, *n;
+ for (g = op->o_groups; g; g=n) {
+ n = g->ga_next;
+ sl_free(g, op->o_tmpmemctx);
+ }
+ op->o_groups = NULL;
+ }
+
+#if defined( LDAP_SLAPI )
+ if ( op->o_pb != NULL ) {
+ slapi_pblock_destroy( (Slapi_PBlock *)op->o_pb );
+ slapi_x_free_object_extensions( SLAPI_X_EXT_OPERATION, op );
+ }
+#endif /* defined( LDAP_SLAPI ) */
+
+ if ( op->o_sync_csn.bv_val != NULL ) {
+ ch_free( op->o_sync_csn.bv_val );
+ }
+
+ memset( op, 0, sizeof(Operation) );
+
+ op->o_sync_state.sid = -1;
+ op->o_sync_slog_size = -1;
+ op->o_sync_state.rid = -1;
+ ldap_pvt_thread_mutex_lock( &slap_op_mutex );
+ LDAP_STAILQ_INSERT_HEAD( &slap_free_ops, op, o_next );
+ ldap_pvt_thread_mutex_unlock( &slap_op_mutex );