aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-nm
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-10-10 13:10:04 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-10-10 13:10:04 +0000
commit1a9908daebd5c416d71ff7fe9c8250074d817733 (patch)
tree91368cdddcaebab4df22d14e32586568b8b93dfd /tools/llvm-nm
parent5d53ff54c0a3eea2cb9585f1f41401d1cc3c81c9 (diff)
llvm-nm: Don't leak bitcode buffers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141534 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-nm')
-rw-r--r--tools/llvm-nm/llvm-nm.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp
index 10cf45072c..550ca4f13f 100644
--- a/tools/llvm-nm/llvm-nm.cpp
+++ b/tools/llvm-nm/llvm-nm.cpp
@@ -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);