Index: chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc |
diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc |
index dfe8d31ca7d128544dd61089546049b3e52e0567..68123b992a1b172c649f91de811dd5d38d3138fa 100644 |
--- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc |
+++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc |
@@ -348,6 +348,7 @@ scoped_ptr<DictionaryValue> GetDictionaryFromArray( |
const std::string* value = array[i+1]; |
if (dictionary->HasKey(*name)) { |
Value* entry = NULL; |
+ scoped_ptr<Value> entry_owned; |
ListValue* list = NULL; |
if (!dictionary->GetWithoutPathExpansion(*name, &entry)) |
return scoped_ptr<DictionaryValue>(); |
@@ -355,8 +356,8 @@ scoped_ptr<DictionaryValue> GetDictionaryFromArray( |
case Value::TYPE_STRING: // Replace the present string with a list. |
list = new ListValue; |
// Ignoring return value, we already verified the entry is there. |
- dictionary->RemoveWithoutPathExpansion(*name, &entry); |
- list->Append(entry); |
+ dictionary->RemoveWithoutPathExpansion(*name, &entry_owned); |
+ list->Append(entry_owned.release()); |
list->Append(Value::CreateStringValue(*value)); |
dictionary->SetWithoutPathExpansion(*name, list); |
break; |