From 0e14156c92b312e339bbdd0689ee6095e88854ad Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 25 Mar 2020 22:25:06 +0100 Subject: [PATCH] lib: Use ARRAY_DEL_ELEMENT in messaging_dispatch_waiters() Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- source3/lib/messages.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 63d6362e0c9..4e301651117 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -1327,12 +1327,8 @@ static bool messaging_dispatch_waiters(struct messaging_context *msg_ctx, * to keep the order of waiters, as * other code may depend on this. */ - if (i < msg_ctx->num_waiters - 1) { - memmove(&msg_ctx->waiters[i], - &msg_ctx->waiters[i+1], - sizeof(struct tevent_req *) * - (msg_ctx->num_waiters - i - 1)); - } + ARRAY_DEL_ELEMENT( + msg_ctx->waiters, i, msg_ctx->num_waiters); msg_ctx->num_waiters -= 1; continue; }