diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 04:22:04 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 04:22:04 +0000 |
commit | b53b53fa095100d30a98d726ccb75968c8d5ea83 (patch) | |
tree | 274ed155a68fd65378eeb093b194b2aea62f71a2 | |
parent | 7c1cf47e757207d6c90a5954ced27c2d108bc7b4 (diff) | |
download | chromium_src-b53b53fa095100d30a98d726ccb75968c8d5ea83.zip chromium_src-b53b53fa095100d30a98d726ccb75968c8d5ea83.tar.gz chromium_src-b53b53fa095100d30a98d726ccb75968c8d5ea83.tar.bz2 |
A quick fix for Bug 53559.
This change uses a scoped_ptr<FormStructure> variable instead of using a FormStructore pointer to avoid leaking FormStructore objects when continuing the loop in AutofillManager::ParseForms().
BUG=53559
TEST=make the "Linux Tests (valgrind)(1)" bot green.
Review URL: http://codereview.chromium.org/3245001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57957 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/autofill/autofill_manager.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc index 9b830c4..0222bd2 100644 --- a/chrome/browser/autofill/autofill_manager.cc +++ b/chrome/browser/autofill/autofill_manager.cc @@ -762,12 +762,12 @@ void AutoFillManager::ParseForms( for (std::vector<FormData>::const_iterator iter = forms.begin(); iter != forms.end(); ++iter) { - FormStructure* form_structure = new FormStructure(*iter); + scoped_ptr<FormStructure> form_structure(new FormStructure(*iter)); if (!form_structure->ShouldBeParsed()) continue; - DeterminePossibleFieldTypes(form_structure); - form_structures_.push_back(form_structure); + DeterminePossibleFieldTypes(form_structure.get()); + form_structures_.push_back(form_structure.release()); } // If none of the forms were parsed, no use querying the server. |