Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6549)

Unified Diff: chrome/browser/password_manager/password_store_mac.cc

Issue 454083002: Fix a memory leak in PasswordStoreMac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: a nit Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/password_manager/password_store_mac_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/password_store_mac.cc
diff --git a/chrome/browser/password_manager/password_store_mac.cc b/chrome/browser/password_manager/password_store_mac.cc
index 5fad2ae20e1fbb20bbd5770af9e9a52b7d41ee8d..06fa7ee9bafe58702489e858960d7ad62bc407a6 100644
--- a/chrome/browser/password_manager/password_store_mac.cc
+++ b/chrome/browser/password_manager/password_store_mac.cc
@@ -618,19 +618,14 @@ std::vector<PasswordForm*> MacKeychainPasswordFormAdapter::PasswordsFillingForm(
return ConvertKeychainItemsToForms(&keychain_items);
}
-PasswordForm* MacKeychainPasswordFormAdapter::PasswordExactlyMatchingForm(
+bool MacKeychainPasswordFormAdapter::HasPasswordExactlyMatchingForm(
const PasswordForm& query_form) {
SecKeychainItemRef keychain_item = KeychainItemForForm(query_form);
if (keychain_item) {
- PasswordForm* form = new PasswordForm();
- internal_keychain_helpers::FillPasswordFormFromKeychainItem(*keychain_,
- keychain_item,
- form,
- true);
keychain_->Free(keychain_item);
- return form;
+ return true;
}
- return NULL;
+ return false;
}
bool MacKeychainPasswordFormAdapter::HasPasswordsMergeableWithForm(
@@ -942,9 +937,7 @@ PasswordStoreChangeList PasswordStoreMac::RemoveLoginImpl(
// handle deletes on them the way we would for an imported item.)
MacKeychainPasswordFormAdapter owned_keychain_adapter(keychain_.get());
owned_keychain_adapter.SetFindsOnlyOwnedItems(true);
- PasswordForm* owned_password_form =
- owned_keychain_adapter.PasswordExactlyMatchingForm(form);
- if (owned_password_form) {
+ if (owned_keychain_adapter.HasPasswordExactlyMatchingForm(form)) {
// If we don't have other forms using it (i.e., a form differing only by
// the names of the form elements), delete the keychain entry.
if (!DatabaseHasFormMatchingKeychainForm(form)) {
« no previous file with comments | « no previous file | chrome/browser/password_manager/password_store_mac_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698