]> git.sur5r.net Git - openldap/commitdiff
cleanup of previous commit
authorPierangelo Masarati <ando@openldap.org>
Sat, 18 Jun 2005 18:59:04 +0000 (18:59 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 18 Jun 2005 18:59:04 +0000 (18:59 +0000)
servers/slapd/overlays/rwm.c

index 28b9135287c1b2daf0bd1a1c7f2810c99f9f0b0e..c1babcfb20c4fea2097a30cf81ecaae4a5e9e321 100644 (file)
@@ -583,7 +583,7 @@ rwm_op_modrdn( Operation *op, SlapReply *rs )
        return SLAP_CB_CONTINUE;
 }
 
-static slap_callback   *rwm_cb;
+static slap_callback   rwm_cb;
 
 static void
 rwm_keyfree(
@@ -598,22 +598,16 @@ rwm_callback_get( Operation *op )
 {
        void            *data = NULL;
 
-       if ( op->o_threadctx ) {
-               ldap_pvt_thread_pool_getkey( op->o_threadctx,
-                               rwm_keyfree, &data, NULL );
-       } else {
-               data = rwm_cb;
+       if ( op->o_threadctx == NULL ) {
+               return &rwm_cb;
        }
 
+       ldap_pvt_thread_pool_getkey( op->o_threadctx,
+                       rwm_keyfree, &data, NULL );
        if ( data == NULL ) {
-               data = ber_memalloc( sizeof( slap_callback ) );
-               if ( op->o_threadctx ) {
-                       ldap_pvt_thread_pool_setkey( op->o_threadctx,
-                                       rwm_keyfree, data, rwm_keyfree );
-
-               } else {
-                       rwm_cb = (slap_callback *)data;
-               }
+               data = ch_calloc( sizeof( slap_callback ), 1 );
+               ldap_pvt_thread_pool_setkey( op->o_threadctx,
+                               rwm_keyfree, data, rwm_keyfree );
        }
 
        return (slap_callback *)data;