Don't free pointer in BasicCodeModules::BasicCodeModules before possibly using it

A=Jim Chen <nchen@mozilla.com>
R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=1033006

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1346 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
ted.mielczarek@gmail.com 2014-07-10 19:16:43 +00:00
parent 21384ad0e2
commit 9e8ffc9fab

View File

@ -64,9 +64,9 @@ BasicCodeModules::BasicCodeModules(const CodeModules *that)
// GetModuleAtIndex because ordering is unimportant when slurping the
// entire list, and GetModuleAtIndex may be faster than
// GetModuleAtSequence.
const CodeModule *module = that->GetModuleAtIndex(module_sequence)->Copy();
if (!map_->StoreRange(module->base_address(), module->size(),
linked_ptr<const CodeModule>(module))) {
linked_ptr<const CodeModule> module(
that->GetModuleAtIndex(module_sequence)->Copy());
if (!map_->StoreRange(module->base_address(), module->size(), module)) {
BPLOG(ERROR) << "Module " << module->code_file() <<
" could not be stored";
}