]> git.sur5r.net Git - openldap/commitdiff
struct slab_heap *sh was accessed through the wrong type
authorHallvard Furuseth <hallvard@openldap.org>
Thu, 14 Jul 2005 21:57:25 +0000 (21:57 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Thu, 14 Jul 2005 21:57:25 +0000 (21:57 +0000)
servers/slapd/sl_malloc.c

index 021bc830aa027b5c13f6ef013a798ca092c7aba4..adf19ca9c8f1ff0408044539061f2a25f8ea2cde 100644 (file)
@@ -95,7 +95,7 @@ slap_sl_mem_create(
        void *ctx
 )
 {
-       struct slab_heap *sh = NULL;
+       struct slab_heap *sh;
        ber_len_t size_shift;
        int pad = 2*sizeof(int)-1, pad_shift;
        int order = -1, order_start = -1, order_end = -1;
@@ -105,8 +105,10 @@ slap_sl_mem_create(
 #ifdef NO_THREADS
        sh = slheap;
 #else
+       void *sh_tmp = NULL;
        ldap_pvt_thread_pool_getkey(
-               ctx, (void *)slap_sl_mem_init, (void **)&sh, NULL );
+               ctx, (void *)slap_sl_mem_init, &sh_tmp, NULL );
+       sh = sh_tmp;
 #endif
 
        /* round up to doubleword boundary */
@@ -549,8 +551,8 @@ slap_sl_free(void *ptr, void *ctx)
 void *
 slap_sl_context( void *ptr )
 {
-       struct slab_heap *sh = NULL;
-       void *ctx;
+       struct slab_heap *sh;
+       void *ctx, *sh_tmp;
 
        if ( slapMode & SLAP_TOOL_MODE ) return NULL;
 
@@ -559,8 +561,10 @@ slap_sl_context( void *ptr )
 #else
        ctx = ldap_pvt_thread_pool_context();
 
-       ldap_pvt_thread_pool_getkey(ctx, (void *)slap_sl_mem_init,
-                       (void **)&sh, NULL);
+       sh_tmp = NULL;
+       ldap_pvt_thread_pool_getkey(
+               ctx, (void *)slap_sl_mem_init, &sh_tmp, NULL);
+       sh = sh_tmp;
 #endif
 
        if (sh && ptr >= sh->sh_base && ptr <= sh->sh_end) {