diff --git a/servers/slapd/back-bdb/tools.c b/servers/slapd/back-bdb/tools.c index bac93bf91b..004583d198 100644 --- a/servers/slapd/back-bdb/tools.c +++ b/servers/slapd/back-bdb/tools.c @@ -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; }