aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TextAPI/MachO/TextStub.cpp
diff options
context:
space:
mode:
authorJuergen Ributzka <juergen@ributzka.de>2018-11-29 06:32:49 +0000
committerJuergen Ributzka <juergen@ributzka.de>2018-11-29 06:32:49 +0000
commitdb3cfda331ca6df976d59eb3f84362bc84c26369 (patch)
tree688ebf4835a661a60672552403e4ec1a4339c00c /llvm/lib/TextAPI/MachO/TextStub.cpp
parent44c54910555759125fc1bacf885ab3f183b3ff43 (diff)
downloadllvm-db3cfda331ca6df976d59eb3f84362bc84c26369.zip
llvm-db3cfda331ca6df976d59eb3f84362bc84c26369.tar.gz
llvm-db3cfda331ca6df976d59eb3f84362bc84c26369.tar.bz2
Revert "[TextAPI] Fix a memory leak in the TBD reader."
llvm-svn: 347838
Diffstat (limited to 'llvm/lib/TextAPI/MachO/TextStub.cpp')
-rw-r--r--llvm/lib/TextAPI/MachO/TextStub.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/TextAPI/MachO/TextStub.cpp b/llvm/lib/TextAPI/MachO/TextStub.cpp
index be4d69c..630663d 100644
--- a/llvm/lib/TextAPI/MachO/TextStub.cpp
+++ b/llvm/lib/TextAPI/MachO/TextStub.cpp
@@ -634,13 +634,11 @@ TextAPIReader::get(std::unique_ptr<MemoryBuffer> InputBuffer) {
std::vector<const InterfaceFile *> Files;
YAMLIn >> Files;
- auto File = std::unique_ptr<InterfaceFile>(
- const_cast<InterfaceFile *>(Files.front()));
-
if (YAMLIn.error())
return make_error<StringError>(Ctx.ErrorMessage, YAMLIn.error());
- return File;
+ auto *File = const_cast<InterfaceFile *>(Files.front());
+ return std::unique_ptr<InterfaceFile>(File);
}
Error TextAPIWriter::writeToStream(raw_ostream &OS, const InterfaceFile &File) {