]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/operation.c
ITS#5490
[openldap] / servers / slapd / operation.c
index d8a4636b1590e2bb62f6a20ea46263779a8f322e..b3ec0372bc4d389353227b4b128ddd22d5e66c01 100644 (file)
@@ -117,13 +117,10 @@ slap_op_free( Operation *op, void *ctx )
        op->o_controls = opbuf->ob_controls;
 
        if ( ctx ) {
-               Operation *op2;
-               void *otmp = NULL;
-               ldap_pvt_thread_pool_getkey( ctx, (void *)slap_op_free, &otmp, NULL );
-               op2 = otmp;
-               LDAP_STAILQ_NEXT( op, o_next ) = op2;
+               void *op2 = NULL;
                ldap_pvt_thread_pool_setkey( ctx, (void *)slap_op_free,
-                       (void *)op, slap_op_q_destroy, NULL, NULL );
+                       op, slap_op_q_destroy, &op2, NULL );
+               LDAP_STAILQ_NEXT( op, o_next ) = op2;
        } else {
                ber_memfree_x( op, NULL );
        }
@@ -132,8 +129,8 @@ slap_op_free( Operation *op, void *ctx )
 void
 slap_op_time(time_t *t, int *nop)
 {
-       *t = slap_get_time();
        ldap_pvt_thread_mutex_lock( &slap_op_mutex );
+       *t = slap_get_time();
        if ( *t == last_time ) {
                *nop = ++last_incr;
        } else {