diff options
| author | Juergen Ributzka <juergen@ributzka.de> | 2018-11-29 06:32:49 +0000 |
|---|---|---|
| committer | Juergen Ributzka <juergen@ributzka.de> | 2018-11-29 06:32:49 +0000 |
| commit | db3cfda331ca6df976d59eb3f84362bc84c26369 (patch) | |
| tree | 688ebf4835a661a60672552403e4ec1a4339c00c /llvm/lib | |
| parent | 44c54910555759125fc1bacf885ab3f183b3ff43 (diff) | |
| download | bcm5719-llvm-db3cfda331ca6df976d59eb3f84362bc84c26369.tar.gz bcm5719-llvm-db3cfda331ca6df976d59eb3f84362bc84c26369.zip | |
Revert "[TextAPI] Fix a memory leak in the TBD reader."
llvm-svn: 347838
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/TextAPI/MachO/TextStub.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/TextAPI/MachO/TextStub.cpp b/llvm/lib/TextAPI/MachO/TextStub.cpp index be4d69c0f62..630663d3ea9 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) { |

