]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-mdb/tools.c
Happy New Year!
[openldap] / servers / slapd / back-mdb / tools.c
index eef1a2aa68f7b51c847eff1bd92f6f6c19b0dbb8..0d3469d85944b0204f6d78f9200139916f1d75e3 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2011-2014 The OpenLDAP Foundation.
+ * Copyright 2011-2016 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -360,10 +360,6 @@ mdb_tool_entry_get_int( BackendDB *be, ID id, Entry **ep )
                rc = mdb_id2name( &op, mdb_tool_txn, &idcursor, id, &dn, &ndn );
                if ( rc  ) {
                        rc = LDAP_OTHER;
-                       if ( e ) {
-                               mdb_entry_return( &op, e );
-                               e = NULL;
-                       }
                        goto done;
                }
                if ( tool_base != NULL ) {
@@ -717,6 +713,7 @@ done:
                        mdb_tool_txn = NULL;
                        idcursor = NULL;
                        if( rc != 0 ) {
+                               mdb->mi_numads = 0;
                                snprintf( text->bv_val, text->bv_len,
                                                "txn_commit failed: %s (%d)",
                                                mdb_strerror(rc), rc );
@@ -987,6 +984,7 @@ done:
        if( rc == 0 ) {
                rc = mdb_txn_commit( mdb_tool_txn );
                if( rc != 0 ) {
+                       mdb->mi_numads = 0;
                        snprintf( text->bv_val, text->bv_len,
                                        "txn_commit failed: %s (%d)",
                                        mdb_strerror(rc), rc );