diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 3eabaf6..d5ec1ad 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -2365,7 +2365,7 @@ PUGI__NS_BEGIN if (header & header_mask) alloc->deallocate_string(dest); // mark the string as not allocated - dest = !shallow_copy ? nullptr : const_cast(source); + dest = source_length ? nullptr : const_cast(source); header &= ~header_mask; return true;