diff options
author | thestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2014-05-28 16:51:52 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2014-05-28 16:51:52 +0000 |
commit | 3cef0e5645c06faf83d06c0dd6432174d2bfd0cc (patch) | |
tree | aab01b5bf1e554624892e5d5d374c7742c14e6e6 | |
parent | Fix minor typo in a comment in r1331. (diff) | |
download | breakpad-3cef0e5645c06faf83d06c0dd6432174d2bfd0cc.tar.xz |
Fix a memory leak in DwarfCUToModule::FuncHandler::Finish().
BUG=591
R=mark@chromium.org
Review URL: https://breakpad.appspot.com/2704002
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1333 4c0a9323-5329-0410-9bdc-e9ce6186880e
-rw-r--r-- | src/common/dwarf_cu_to_module.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index 8246daf9..1d157def 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -531,7 +531,7 @@ void DwarfCUToModule::FuncHandler::Finish() { if (low_pc_ < high_pc_) { // Create a Module::Function based on the data we've gathered, and // add it to the functions_ list. - Module::Function *func = new Module::Function; + scoped_ptr<Module::Function> func(new Module::Function); // Malformed DWARF may omit the name, but all Module::Functions must // have names. if (!name_.empty()) { @@ -546,7 +546,7 @@ void DwarfCUToModule::FuncHandler::Finish() { if (func->address) { // If the function address is zero this is a sign that this function // description is just empty debug data and should just be discarded. - cu_context_->functions.push_back(func); + cu_context_->functions.push_back(func.release()); } } else if (inline_) { AbstractOrigin origin(name_); |