X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Foperation.c;h=024139db7da9e4bfca18a2691cddce62c2a47007;hb=7fe91339dfd08d6c4168c8493f5c1f0faca6ba54;hp=124a3b85b90b8d2060f9c593fee4216f8b987172;hpb=68ebee4726e0080a4dc3c07add3012b65a105a31;p=openldap diff --git a/servers/slapd/operation.c b/servers/slapd/operation.c index 124a3b85b9..024139db7d 100644 --- a/servers/slapd/operation.c +++ b/servers/slapd/operation.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2007 The OpenLDAP Foundation. + * Copyright 1998-2009 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -111,19 +111,21 @@ slap_op_free( Operation *op, void *ctx ) } #endif /* defined( LDAP_SLAPI ) */ + if ( !BER_BVISNULL( &op->o_csn ) ) { + op->o_tmpfree( op->o_csn.bv_val, op->o_tmpmemctx ); + BER_BVZERO( &op->o_csn ); + } + opbuf = (OperationBuffer *) op; memset( opbuf, 0, sizeof(*opbuf) ); op->o_hdr = &opbuf->ob_hdr; 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; + void *op2 = NULL; + ldap_pvt_thread_pool_setkey( ctx, (void *)slap_op_free, + op, slap_op_q_destroy, &op2, NULL ); LDAP_STAILQ_NEXT( op, o_next ) = op2; - ldap_pvt_thread_pool_setkey( ctx, (void *)slap_op_free, (void *)op, - slap_op_q_destroy ); } else { ber_memfree_x( op, NULL ); } @@ -132,8 +134,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 { @@ -160,8 +162,8 @@ slap_op_alloc( if ( otmp ) { op = otmp; otmp = LDAP_STAILQ_NEXT( op, o_next ); - ldap_pvt_thread_pool_setkey( ctx, (void *)slap_op_free, otmp, - slap_op_q_destroy ); + ldap_pvt_thread_pool_setkey( ctx, (void *)slap_op_free, + otmp, slap_op_q_destroy, NULL, NULL ); } } if (!op) {