]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/referral.c
Fix ITS#3255, boi_bdb comparisons
[openldap] / servers / slapd / back-bdb / referral.c
index ea9dcfd86d533bd9119b18c53b98591f000017d3..d69c35a7d9eab4ff75e2ade0926d6119c2a2d807 100644 (file)
@@ -1,8 +1,17 @@
 /* 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"
@@ -43,8 +52,7 @@ bdb_referrals( Operation *op, SlapReply *rs )
 
 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) {
@@ -118,7 +126,7 @@ dn2entry_retry:
 
                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;
@@ -142,7 +150,7 @@ dn2entry_retry:
 
                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;