]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/connection.c
Fix C errors
[openldap] / servers / slapd / connection.c
index 9aa78de007e8a9981d6514607e5bfc5fd80c1d12..6dcd35ee757767031b312c3e2347d3600c17b00a 100644 (file)
@@ -1111,7 +1111,7 @@ connection_operation( void *ctx, void *arg_v )
 #endif
        memsiz = SLAP_SLAB_SIZE;
 
-       memctx = slap_sl_mem_create( memsiz, SLAP_SLAB_STACK, ctx );
+       memctx = slap_sl_mem_create( memsiz, SLAP_SLAB_STACK, ctx, 1 );
        op->o_tmpmemctx = memctx;
        op->o_tmpmfuncs = &slap_sl_mfuncs;
        if ( tag != LDAP_REQ_ADD && tag != LDAP_REQ_MODIFY ) {
@@ -1970,8 +1970,6 @@ connection_fake_destroy(
        conn.c_connid = -1;
        op.o_connid = -1;
 
-       Debug(LDAP_DEBUG_ANY, "connection_fake_destroy: %p\n", eb, 0, 0 );
-
        ber_memfree_x( eb, NULL );
        slapi_int_free_object_extensions( SLAPI_X_EXT_OPERATION, &op );
        slapi_int_free_object_extensions( SLAPI_X_EXT_CONNECTION, &conn );
@@ -1983,6 +1981,16 @@ connection_fake_init(
        Connection *conn,
        Operation *op,
        void *ctx )
+{
+       connection_fake_init2( conn, op, ctx, 0 );
+}
+
+void
+connection_fake_init2(
+       Connection *conn,
+       Operation *op,
+       void *ctx,
+       int newmem )
 {
        conn->c_connid = -1;
        conn->c_send_ldap_result = slap_send_ldap_result;
@@ -1996,7 +2004,8 @@ connection_fake_init(
        op->o_hdr = (Opheader *)(op+1);
        op->o_controls = (void **)(op->o_hdr+1);
        /* set memory context */
-       op->o_tmpmemctx = slap_sl_mem_create(SLAP_SLAB_SIZE, SLAP_SLAB_STACK, ctx);
+       op->o_tmpmemctx = slap_sl_mem_create(SLAP_SLAB_SIZE, SLAP_SLAB_STACK, ctx,
+               newmem );
        op->o_tmpmfuncs = &slap_sl_mfuncs;
        op->o_threadctx = ctx;
        op->o_tid = ldap_pvt_thread_pool_tid( ctx );
@@ -2013,7 +2022,6 @@ connection_fake_init(
                if ( ldap_pvt_thread_pool_getkey( ctx, connection_fake_init, &eb,
                        NULL )) {
                        eb = ch_malloc( sizeof( *eb ));
-                       Debug(LDAP_DEBUG_ANY, "connection_fake_init: ctx %p, %p\n", ctx, eb, 0 );
                        slapi_int_create_object_extensions( SLAPI_X_EXT_CONNECTION, conn );
                        slapi_int_create_object_extensions( SLAPI_X_EXT_OPERATION, op );
                        eb->eb_conn = conn->c_extensions;