From c8059b5d3c1e58a2763feeb3b2b83b8d43085d59 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= Date: Fri, 10 Jun 2022 09:39:18 +0100 Subject: [PATCH] ITS#8245 Do not try to release a NULL entry --- servers/slapd/overlays/unique.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/servers/slapd/overlays/unique.c b/servers/slapd/overlays/unique.c index 952c1edf57..7a7c8fb540 100644 --- a/servers/slapd/overlays/unique.c +++ b/servers/slapd/overlays/unique.c @@ -1225,13 +1225,15 @@ unique_modify( return rc; } - if ( SLAPD_SYNC_IS_SYNCCONN( op->o_connid ) || ( - get_relax(op) > SLAP_CONTROL_IGNORED - && overlay_entry_get_ov(op, &op->o_req_ndn, NULL, NULL, 0, &e, on) == LDAP_SUCCESS - && e - && access_allowed( op, e, - slap_schema.si_ad_entry, NULL, - ACL_MANAGE, NULL ) ) ) { + if ( SLAPD_SYNC_IS_SYNCCONN( op->o_connid ) ) { + return rc; + } + if ( get_relax(op) > SLAP_CONTROL_IGNORED + && overlay_entry_get_ov( op, &op->o_req_ndn, NULL, NULL, 0, &e, on ) == LDAP_SUCCESS + && e + && access_allowed( op, e, + slap_schema.si_ad_entry, NULL, + ACL_MANAGE, NULL ) ) { overlay_entry_release_ov( op, e, 0, on ); return rc; } @@ -1363,13 +1365,15 @@ unique_modrdn( Debug(LDAP_DEBUG_TRACE, "==> unique_modrdn <%s> <%s>\n", op->o_req_dn.bv_val, op->orr_newrdn.bv_val ); - if ( SLAPD_SYNC_IS_SYNCCONN( op->o_connid ) || ( - get_relax(op) > SLAP_CONTROL_IGNORED - && overlay_entry_get_ov(op, &op->o_req_ndn, NULL, NULL, 0, &e, on) == LDAP_SUCCESS - && e - && access_allowed( op, e, - slap_schema.si_ad_entry, NULL, - ACL_MANAGE, NULL ) ) ) { + if ( SLAPD_SYNC_IS_SYNCCONN( op->o_connid ) ) { + return rc; + } + if ( get_relax(op) > SLAP_CONTROL_IGNORED + && overlay_entry_get_ov( op, &op->o_req_ndn, NULL, NULL, 0, &e, on ) == LDAP_SUCCESS + && e + && access_allowed( op, e, + slap_schema.si_ad_entry, NULL, + ACL_MANAGE, NULL ) ) { overlay_entry_release_ov( op, e, 0, on ); return rc; } -- 2.47.2