]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backend.c
Merge remote-tracking branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_4
[openldap] / servers / slapd / backend.c
index c5b01a06b42320da84e9d3f8608e606bac77a708..bde9f1a4606c779eb841158c193afcc3b3ebe8ea 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2011 The OpenLDAP Foundation.
+ * Copyright 1998-2014 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -464,6 +464,9 @@ void backend_destroy_one( BackendDB *bd, int dynamic )
        }
        acl_destroy( bd->be_acl );
        limits_destroy( bd->be_limits );
+       if ( bd->be_extra_anlist ) {
+               anlist_free( bd->be_extra_anlist, 1, NULL );
+       }
        if ( !BER_BVISNULL( &bd->be_update_ndn ) ) {
                ch_free( bd->be_update_ndn.bv_val );
        }
@@ -1791,9 +1794,9 @@ backend_access(
        slap_mask_t             *mask )
 {
        Entry           *e = NULL;
-       void            *o_priv = op->o_private, *e_priv = NULL;
+       void            *o_priv, *e_priv = NULL;
        int             rc = LDAP_INSUFFICIENT_ACCESS;
-       Backend         *be = op->o_bd;
+       Backend         *be;
 
        /* pedantic */
        assert( op != NULL );
@@ -1801,6 +1804,9 @@ backend_access(
        assert( edn != NULL );
        assert( access > ACL_NONE );
 
+       be = op->o_bd;
+       o_priv = op->o_private;
+
        if ( !op->o_bd ) {
                op->o_bd = select_backend( edn, 0 );
        }