summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-06 20:43:36 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-06 20:43:36 +0000
commit615692439512c071103d1e4418b187c4e30bac45 (patch)
tree03f3df1b78ac827ae0b1c3a78488d5914b2f7efe /chrome/browser
parentb2cef331ec4b2bdb22a2f27cf16b1f8c6c51b5b0 (diff)
downloadchromium_src-615692439512c071103d1e4418b187c4e30bac45.zip
chromium_src-615692439512c071103d1e4418b187c4e30bac45.tar.gz
chromium_src-615692439512c071103d1e4418b187c4e30bac45.tar.bz2
Fix a possible crash introduced by r46412 by not accessing the result variable before the NULL check
BUG=43408 TEST=none Patch by Benjamin Jemlich <pcgod99@gmail.com>. Review URL: http://codereview.chromium.org/2035003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46614 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/password_manager/password_store_default.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/chrome/browser/password_manager/password_store_default.cc b/chrome/browser/password_manager/password_store_default.cc
index 31049dd..6c0a8fe 100644
--- a/chrome/browser/password_manager/password_store_default.cc
+++ b/chrome/browser/password_manager/password_store_default.cc
@@ -116,17 +116,16 @@ void PasswordStoreDefault::OnWebDataServiceRequestDone(
WebDataService::Handle handle,
const WDTypedResult* result) {
DCHECK(handles_.end() != handles_.find(handle));
- DCHECK(result);
+
+ handles_.erase(handle);
+ if (!result)
+ return;
if (PASSWORD_RESULT != result->GetType()) {
NOTREACHED();
return;
}
- handles_.erase(handle);
- if (!result)
- return;
-
const PasswordForms& forms =
static_cast<const WDResult<PasswordForms>*>(result)->GetValue();
for (PasswordForms::const_iterator it = forms.begin();