Fix memory leak in DisassemblerX86.

A memory leak in DisassemblerX86 is detected by valgrind. This patch
fixes the DisassemblerX86 destructor to properly free the |current_instr_|
variable.

BUG=471
TEST=Run valgrind on disassembler_x86_unittest to verify the leak is gone.
Review URL: https://breakpad.appspot.com/371001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@940 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
benchan@chromium.org 2012-03-30 21:01:09 +00:00
parent f6147a6460
commit 1d8752bf0f

View file

@ -48,6 +48,9 @@ DisassemblerX86::DisassemblerX86(const u_int8_t *bytecode,
}
DisassemblerX86::~DisassemblerX86() {
if (instr_valid_)
libdis::x86_oplist_free(&current_instr_);
libdis::x86_cleanup();
}