]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/tools.c
Happy New Year
[openldap] / servers / slapd / back-bdb / tools.c
index 1ec1053dfdc26f9b3ce0f49b3ec3cabc11f5499c..75e6e47e2b0ca22fbe052014b67f021797ab72a7 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2015 The OpenLDAP Foundation.
+ * Copyright 2000-2018 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -1158,9 +1158,12 @@ done:
                }
        }
 
-       rc = bdb->bi_id2entry->bdi_db->cursor(
-               bdb->bi_id2entry->bdi_db, bdb->bi_cache.c_txn, &cursor,
-               bdb->bi_db_opflags );
+       if ( cursor == NULL )
+       {
+               rc = bdb->bi_id2entry->bdi_db->cursor(
+                       bdb->bi_id2entry->bdi_db, bdb->bi_cache.c_txn, &cursor,
+                       bdb->bi_db_opflags );
+       }
 
        return rc;
 }