From: Volker Lendecke Date: Thu, 26 Mar 2020 10:12:55 +0000 (+0100) Subject: ldb: Use ARRAY_DEL_ELEMENT() in ldb_dn_set_extended_component() X-Git-Tag: ldb-2.2.0~1204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=130502af0be73bc17697ae318b42e3255b426fa6;p=thirdparty%2Fsamba.git ldb: Use ARRAY_DEL_ELEMENT() in ldb_dn_set_extended_component() Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- 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,