llvm-nm: Don't leak bitcode buffers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141534 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2011-10-10 13:10:04 +00:00
parent 5d53ff54c0
commit 1a9908daeb

View File

@ -330,10 +330,10 @@ static void DumpSymbolNamesFromFile(std::string &Filename) {
OwningPtr<Binary> child;
if (error_code ec = i->getAsBinary(child)) {
// Try opening it as a bitcode file.
MemoryBuffer *buff = i->getBuffer();
OwningPtr<MemoryBuffer> buff(i->getBuffer());
Module *Result = 0;
if (buff)
Result = ParseBitcodeFile(buff, Context, &ErrorMessage);
Result = ParseBitcodeFile(buff.get(), Context, &ErrorMessage);
if (Result) {
DumpSymbolNamesFromModule(Result);