]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-mdb/dn2entry.c
ITS#7912 fix index config
[openldap] / servers / slapd / back-mdb / dn2entry.c
index 16c50877ddf45c1b20dd116f2716971cdf0cfe3e..230207de6084d992367b9c6c702c4e01ebaae664 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2012 The OpenLDAP Foundation.
+ * Copyright 2000-2014 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -34,6 +34,7 @@ mdb_dn2entry(
        MDB_cursor *m2,
        struct berval *dn,
        Entry **e,
+       ID *nsubs,
        int matched )
 {
        struct mdb_info *mdb = (struct mdb_info *) op->o_bd->be_private;
@@ -47,7 +48,7 @@ mdb_dn2entry(
 
        *e = NULL;
 
-       rc = mdb_dn2id( op, tid, m2, dn, &id, &mbv, &nmbv );
+       rc = mdb_dn2id( op, tid, m2, dn, &id, nsubs, &mbv, &nmbv );
        if ( rc ) {
                if ( matched ) {
                        rc2 = mdb_cursor_open( tid, mdb->mi_id2entry, &mc );
@@ -70,6 +71,8 @@ mdb_dn2entry(
                        ber_dupbv_x( &(*e)->e_nname, dn, op->o_tmpmemctx );
                else
                        ber_dupbv_x( &(*e)->e_nname, &nmbv, op->o_tmpmemctx );
+       } else {
+               op->o_tmpfree( mbv.bv_val, op->o_tmpmemctx );
        }
 
        return rc;