Index: components/sync_preferences/pref_model_associator.cc |
diff --git a/components/sync_preferences/pref_model_associator.cc b/components/sync_preferences/pref_model_associator.cc |
index 6bb1801dc52a0ce53b1d64d4449b331e133164d8..1231784aa7db38fb187d7119ca53e481d8a718ad 100644 |
--- a/components/sync_preferences/pref_model_associator.cc |
+++ b/components/sync_preferences/pref_model_associator.cc |
@@ -319,14 +319,15 @@ base::Value* PrefModelAssociator::MergeDictionaryValues( |
if (result->GetWithoutPathExpansion(it.key(), &to_key_value)) { |
if (from_key_value->GetType() == base::Value::Type::DICTIONARY && |
to_key_value->GetType() == base::Value::Type::DICTIONARY) { |
- base::Value* merged_value = |
- MergeDictionaryValues(*from_key_value, *to_key_value); |
- result->SetWithoutPathExpansion(it.key(), merged_value); |
+ std::unique_ptr<base::Value> merged_value( |
+ MergeDictionaryValues(*from_key_value, *to_key_value)); |
+ result->SetWithoutPathExpansion(it.key(), std::move(merged_value)); |
} |
// Note that for all other types we want to preserve the "to" |
// values so we do nothing here. |
} else { |
- result->SetWithoutPathExpansion(it.key(), from_key_value->DeepCopy()); |
+ result->SetWithoutPathExpansion(it.key(), |
+ from_key_value->CreateDeepCopy()); |
} |
} |
return result; |