diff --git a/src/util/IntrusiveList.hxx b/src/util/IntrusiveList.hxx index e5af95e16..a004759a0 100644 --- a/src/util/IntrusiveList.hxx +++ b/src/util/IntrusiveList.hxx @@ -538,6 +538,10 @@ public: * Like insert(), but insert after the given position. */ void insert_after(iterator p, reference t) noexcept { + if constexpr (options.zero_initialized) + if (head.next == nullptr) + head = {&head, &head}; + insert(std::next(p), t); }