diff --git a/src/regex_raw_buffer.cpp b/src/regex_raw_buffer.cpp index 84a2fd5d..f75f0a51 100644 --- a/src/regex_raw_buffer.cpp +++ b/src/regex_raw_buffer.cpp @@ -46,7 +46,8 @@ void BOOST_REGEX_CALL raw_storage::resize(size_type n) // allocate and copy data: register pointer ptr = static_cast(::operator new(newsize)); BOOST_REGEX_NOEH_ASSERT(ptr) - std::memcpy(ptr, start, datasize); + if(start) + std::memcpy(ptr, start, datasize); // get rid of old buffer: ::operator delete(start);