Note that there is an overload of strip_extra_spaces taking a std::string&

The char* overload is called by MsgString in zq_strings.cpp, which allocates a 71 character array on the heap to pass to strip_extra_spaces. It's probably fine to allocate that on the stack instead.