summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 689b24f398..e184181f01 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -2038,10 +2038,9 @@ static int replmd_delete_remove_link(struct ldb_module *module,
msg->dn = dsdb_dn->dn;
- if (sa->linkID & 1) {
- target_attr = dsdb_attribute_by_linkID(schema, sa->linkID - 1);
- } else {
- target_attr = dsdb_attribute_by_linkID(schema, sa->linkID + 1);
+ target_attr = dsdb_attribute_by_linkID(schema, sa->linkID ^ 1);
+ if (target_attr == NULL) {
+ continue;
}
ret = ldb_msg_add_empty(msg, target_attr->lDAPDisplayName, LDB_FLAG_MOD_DELETE, &el2);