diff --git a/src/zm_comms.h b/src/zm_comms.h index 070ed5395..ce316b17b 100644 --- a/src/zm_comms.h +++ b/src/zm_comms.h @@ -244,6 +244,7 @@ class Socket : public CommsBase { } virtual ssize_t recv(std::string &msg) const { + msg.reserve(ZM_NETWORK_BUFSIZ); std::vector buffer(msg.capacity()); ssize_t nBytes; if ((nBytes = ::recv(mSd, buffer.data(), buffer.size(), 0)) < 0) {