Permalink
Browse files

[readobj] Fix memory leak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174687 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information...
1 parent ea007fa commit dc0f8a3fd993f5db67e121b0e2c132ac4d104a24 @Bigcheese Bigcheese committed Feb 8, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 tools/llvm-readobj/llvm-readobj.cpp
@@ -240,7 +240,8 @@ int main(int argc, char** argv) {
return 1;
}
- ObjectFile *obj = ObjectFile::createObjectFile(File.take());
+ OwningPtr<ObjectFile> o(ObjectFile::createObjectFile(File.take()));
+ ObjectFile *obj = o.get();
if (!obj) {
errs() << InputFilename << ": Object type not recognized\n";
}

0 comments on commit dc0f8a3

Please sign in to comment.