]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-mdb/add.c
Merge remote-tracking branch 'origin/mdb.master'
[openldap] / servers / slapd / back-mdb / add.c
index 332d5c6b210c9f87b83919d299471e62b2604804..b92e922ec78c89dfd222e124c96d5438c2dcc863 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2013 The OpenLDAP Foundation.
+ * Copyright 2000-2014 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -338,7 +338,7 @@ txnReturn:
        op->ora_e->e_id = eid;
 
        /* dn2id index */
-       rs->sr_err = mdb_dn2id_add( op, mcd, mcd, pid, 1, op->ora_e );
+       rs->sr_err = mdb_dn2id_add( op, mcd, mcd, pid, 1, 1, op->ora_e );
        mdb_cursor_close( mcd );
        if ( rs->sr_err != 0 ) {
                Debug( LDAP_DEBUG_TRACE,
@@ -438,6 +438,8 @@ return_results:
                if ( opinfo.moi_oe.oe_key ) {
                        LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.moi_oe, OpExtra, oe_next );
                }
+       } else {
+               moi->moi_ref--;
        }
 
        if( success == LDAP_SUCCESS ) {