diff --git a/src/queue/Queue.cxx b/src/queue/Queue.cxx index c4d0aac2b..463e673e1 100644 --- a/src/queue/Queue.cxx +++ b/src/queue/Queue.cxx @@ -150,7 +150,8 @@ Queue::MovePostion(unsigned from, unsigned to) noexcept void Queue::MoveRange(unsigned start, unsigned end, unsigned to) noexcept { - Item tmp[end - start]; + const auto tmp = std::make_unique(end - start); + // Copy the original block [start,end-1] for (unsigned i = start; i < end; i++) tmp[i - start] = items[i];