[llvm] r214313 - llvm-uselistorder: Fix memory leak from r214125
Duncan P. N. Exon Smith
dexonsmith at apple.com
Wed Jul 30 09:50:22 PDT 2014
Author: dexonsmith
Date: Wed Jul 30 11:50:22 2014
New Revision: 214313
URL: http://llvm.org/viewvc/llvm-project?rev=214313&view=rev
Log:
llvm-uselistorder: Fix memory leak from r214125
Turns out `parseBitcodeFile()` does *not* take ownership of the buffer.
This was already clear in the header docs, but I obviously didn't read
them (having noticed that it gets stored in a `unique_ptr<>`).
Modified:
llvm/trunk/tools/llvm-uselistorder/llvm-uselistorder.cpp
Modified: llvm/trunk/tools/llvm-uselistorder/llvm-uselistorder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-uselistorder/llvm-uselistorder.cpp?rev=214313&r1=214312&r2=214313&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-uselistorder/llvm-uselistorder.cpp (original)
+++ llvm/trunk/tools/llvm-uselistorder/llvm-uselistorder.cpp Wed Jul 30 11:50:22 2014
@@ -137,7 +137,7 @@ std::unique_ptr<Module> TempFile::readBi
}
std::unique_ptr<MemoryBuffer> Buffer = std::move(BufferOr.get());
- ErrorOr<Module *> ModuleOr = parseBitcodeFile(Buffer.release(), Context);
+ ErrorOr<Module *> ModuleOr = parseBitcodeFile(Buffer.get(), Context);
if (!ModuleOr) {
DEBUG(dbgs() << "error: " << ModuleOr.getError().message() << "\n");
return nullptr;
More information about the llvm-commits
mailing list