Return copy of XML dump

COFF/DriverUtils.cpp uses buffer after WindowsManifestMerger destroyed.

llvm-svn: 312408
This commit is contained in:
Vitaly Buka 2017-09-02 05:14:55 +00:00
parent 3d8e509fd7
commit 5c5b5a6253
1 changed files with 1 additions and 1 deletions

View File

@ -677,7 +677,7 @@ WindowsManifestMerger::WindowsManifestMergerImpl::getMergedManifest() {
Buffer.reset(Buff); Buffer.reset(Buff);
} }
return BufferSize ? MemoryBuffer::getMemBuffer(StringRef( return BufferSize ? MemoryBuffer::getMemBufferCopy(StringRef(
FROM_XML_CHAR(Buffer.get()), (size_t)BufferSize)) FROM_XML_CHAR(Buffer.get()), (size_t)BufferSize))
: nullptr; : nullptr;
} }