X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-bdb%2Ftools.c;h=75e6e47e2b0ca22fbe052014b67f021797ab72a7;hb=59e9ff6243465640956b58ad1756a3ede53eca7c;hp=1ec1053dfdc26f9b3ce0f49b3ec3cabc11f5499c;hpb=83734af7cb3d6293fe6d8303a0bf4d484fe7b41e;p=openldap diff --git a/servers/slapd/back-bdb/tools.c b/servers/slapd/back-bdb/tools.c index 1ec1053dfd..75e6e47e2b 100644 --- a/servers/slapd/back-bdb/tools.c +++ b/servers/slapd/back-bdb/tools.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * 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; }