diff --git a/lib/icingadb/redisconnection.hpp b/lib/icingadb/redisconnection.hpp index 0a9bfd61d..608b11e0d 100644 --- a/lib/icingadb/redisconnection.hpp +++ b/lib/icingadb/redisconnection.hpp @@ -555,12 +555,12 @@ Value RedisConnection::ReadRESP(AsyncReadStream& stream, boost::asio::yield_cont throw BadRedisInt(std::move(buf)); } - Array::Ptr arr = new Array(); - if (i < 0) { - i = 0; + return Empty; } + Array::Ptr arr = new Array(); + arr->Reserve(i); for (; i; --i) {