X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=servers%2Fslapd%2Fslapauth.c;h=9b82e7db7079a53c4a9f0a61abc12289be64f9fb;hb=850e4ae0d3a159f7d38e25ff13e5ecfb2842eb57;hp=d0c041873bd61692c904fc502d4bc4baee01c8f4;hpb=6db7e605ee06b033f260d0dc02dcd4ed189a12a2;p=openldap diff --git a/servers/slapd/slapauth.c b/servers/slapd/slapauth.c index d0c041873b..9b82e7db70 100644 --- a/servers/slapd/slapauth.c +++ b/servers/slapd/slapauth.c @@ -1,6 +1,7 @@ +/* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2004-2005 The OpenLDAP Foundation. + * Copyright 2004-2009 The OpenLDAP Foundation. * Portions Copyright 2004 Pierangelo Masarati. * All rights reserved. * @@ -82,14 +83,16 @@ slapauth( int argc, char **argv ) Connection conn = {0}; OperationBuffer opbuf; Operation *op; + void *thrctx; slap_tool_init( progname, SLAPAUTH, argc, argv ); argv = &argv[ optind ]; argc -= optind; - op = (Operation *) &opbuf; - connection_fake_init( &conn, op, &conn ); + thrctx = ldap_pvt_thread_pool_context(); + connection_fake_init( &conn, &opbuf, thrctx ); + op = &opbuf.ob_op; conn.c_sasl_bind_mech = mech; @@ -166,7 +169,8 @@ destroy:; if ( !BER_BVISNULL( &authzID ) ) { op->o_tmpfree( authzID.bv_val, op->o_tmpmemctx ); } - slap_tool_destroy(); + if ( slap_tool_destroy()) + rc = EXIT_FAILURE; return rc; }