fix a memory leak

llvm-svn: 36981
This commit is contained in:
Chris Lattner 2007-05-11 00:43:26 +00:00
parent fd96905f12
commit 436370bac8
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ void MemoryBuffer::initCopyOf(const char *BufStart, const char *BufEnd) {
BufferEnd = BufferStart+Size;
memcpy(const_cast<char*>(BufferStart), BufStart, Size);
*const_cast<char*>(BufferEnd) = 0; // Null terminate buffer.
MustDeleteBuffer = false;
MustDeleteBuffer = true;
}
/// init - Initialize this MemoryBuffer as a reference to externally allocated