From 5e6aadd7794b13394b94bd5ba777a66facdc9a7e Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 22 Jul 2016 10:30:57 +0100 Subject: [PATCH] More for multival attrs Fix id2entry_delete when deleting last multival entry in DB --- servers/slapd/back-mdb/id2entry.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-mdb/id2entry.c b/servers/slapd/back-mdb/id2entry.c index fe1f882732..d69e6a52aa 100644 --- a/servers/slapd/back-mdb/id2entry.c +++ b/servers/slapd/back-mdb/id2entry.c @@ -407,7 +407,12 @@ int mdb_id2entry_delete( rc = mdb_cursor_del( mvc, MDB_NODUPDATA ); if (rc) return rc; - mdb_cursor_get( mvc, &key, NULL, MDB_GET_CURRENT ); + rc = mdb_cursor_get( mvc, &key, NULL, MDB_GET_CURRENT ); + if (rc) { + if (rc == MDB_NOTFOUND) + rc = MDB_SUCCESS; + break; + } } return rc; } -- 2.39.5