diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-02-08 01:05:48 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2013-02-08 01:05:48 +0000 |
commit | dc0f8a3fd993f5db67e121b0e2c132ac4d104a24 (patch) | |
tree | 72a7fae5a3583f3425b66cc0053b67448b91bd49 /tools/llvm-readobj/llvm-readobj.cpp | |
parent | ea007fa608146acdfc5b889a1d86a4ac7c528bf7 (diff) |
[readobj] Fix memory leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174687 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-readobj/llvm-readobj.cpp')
-rw-r--r-- | tools/llvm-readobj/llvm-readobj.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/llvm-readobj/llvm-readobj.cpp b/tools/llvm-readobj/llvm-readobj.cpp index 2edb660cf9..0a43775ef2 100644 --- a/tools/llvm-readobj/llvm-readobj.cpp +++ b/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"; } |