From 130502af0be73bc17697ae318b42e3255b426fa6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 26 Mar 2020 11:12:55 +0100 Subject: ldb: Use ARRAY_DEL_ELEMENT() in ldb_dn_set_extended_component() Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- lib/ldb/common/ldb_dn.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/ldb/common/ldb_dn.c b/lib/ldb/common/ldb_dn.c index 54c845c38ba..001fcad621f 100644 --- a/lib/ldb/common/ldb_dn.c +++ b/lib/ldb/common/ldb_dn.c @@ -2062,12 +2062,10 @@ int ldb_dn_set_extended_component(struct ldb_dn *dn, return LDB_ERR_OPERATIONS_ERROR; } } else { - if (i != (dn->ext_comp_num - 1)) { - memmove(&dn->ext_components[i], - &dn->ext_components[i+1], - ((dn->ext_comp_num-1) - i) * - sizeof(*dn->ext_components)); - } + ARRAY_DEL_ELEMENT( + dn->ext_components, + i, + dn->ext_comp_num); dn->ext_comp_num--; dn->ext_components = talloc_realloc(dn, -- cgit v1.2.1