[llvm-commits] [llvm] r128241 - /llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
Johnny Chen
johnny.chen at apple.com
Thu Mar 24 14:42:55 PDT 2011
Author: johnny
Date: Thu Mar 24 16:42:55 2011
New Revision: 128241
URL: http://llvm.org/viewvc/llvm-project?rev=128241&view=rev
Log:
Plug a leak by ThumbDisassembler::getInstruction(), thanks to Benjamin Kramer!
Modified:
llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
Modified: llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp?rev=128241&r1=128240&r2=128241&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Disassembler/ARMDisassembler.cpp Thu Mar 24 16:42:55 2011
@@ -465,7 +465,7 @@
showBitVector(errs(), insn);
});
- ARMBasicMCBuilder *Builder = CreateMCBuilder(Opcode, Format);
+ OwningPtr<ARMBasicMCBuilder> Builder(CreateMCBuilder(Opcode, Format));
if (!Builder)
return false;
@@ -474,8 +474,6 @@
if (!Builder->Build(MI, insn))
return false;
- delete Builder;
-
return true;
}
More information about the llvm-commits
mailing list