From e74e85ee66e9ecd3b0ecb8851aad73fc7b05a1ce Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 26 Mar 2020 11:02:02 +0100 Subject: [PATCH] dsdb: Use ARRAY_DEL_ELEMENT() in dirsync_filter_entry() Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- source4/dsdb/samdb/ldb_modules/dirsync.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source4/dsdb/samdb/ldb_modules/dirsync.c b/source4/dsdb/samdb/ldb_modules/dirsync.c index 1dfdf3d2447..21555491159 100644 --- a/source4/dsdb/samdb/ldb_modules/dirsync.c +++ b/source4/dsdb/samdb/ldb_modules/dirsync.c @@ -604,11 +604,10 @@ skip: if (dsc->linkIncrVal == false) { if (flags & DSDB_RMD_FLAG_DELETED) { - if (k < (el->num_values - 1)) { - memmove(el->values + k, - el->values + (k + 1), - ((el->num_values - 1) - k)*sizeof(*el->values)); - } + ARRAY_DEL_ELEMENT( + el->values, + k, + el->num_values); el->num_values--; } }