/* referral.c - BDB backend referral handler */
/* $OpenLDAP$ */
-/*
- * Copyright 2000-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 2000-2004 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
*/
#include "portable.h"
dn2entry_retry:
/* get entry */
- rc = bdb_dn2entry( op->o_bd, NULL, &op->o_req_ndn, &ei, 1, locker,
- &lock, op->o_tmpmemctx );
+ rc = bdb_dn2entry( op, NULL, &op->o_req_ndn, &ei, 1, locker, &lock );
e = ei->bei_e;
switch(rc) {
LOCK_ID_FREE ( bdb->bi_dbenv, locker );
if (rs->sr_matched) {
- sl_free( (char *)rs->sr_matched, op->o_tmpmemctx );
+ op->o_tmpfree( (char *)rs->sr_matched, op->o_tmpmemctx );
rs->sr_matched = NULL;
}
return rc;
rs->sr_matched = e->e_name.bv_val;
if( rs->sr_ref != NULL ) {
- rs->sr_err = LDAP_REFERRAL;
+ rc = rs->sr_err = LDAP_REFERRAL;
send_ldap_result( op, rs );
ber_bvarray_free( rs->sr_ref );
rs->sr_ref = NULL;