Index: chrome/test/ui/ui_test.cc |
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc |
index 4d58e6a316632599b23df95229660c354cbcfb1e..e1bea1b30ccfa2fbe7cf58140e60e277b522b786 100644 |
--- a/chrome/test/ui/ui_test.cc |
+++ b/chrome/test/ui/ui_test.cc |
@@ -497,13 +497,11 @@ static DictionaryValue* LoadDictionaryValueFromPath(const std::wstring& path) { |
return NULL; |
JSONFileValueSerializer serializer(path); |
- Value* root_value = NULL; |
- if (serializer.Deserialize(&root_value, NULL) && |
- root_value->GetType() != Value::TYPE_DICTIONARY) { |
- delete root_value; |
+ scoped_ptr<Value> root_value(serializer.Deserialize(NULL)); |
+ if (!root_value.get() || root_value->GetType() != Value::TYPE_DICTIONARY) |
return NULL; |
- } |
- return static_cast<DictionaryValue*>(root_value); |
+ |
+ return static_cast<DictionaryValue*>(root_value.release()); |
} |
DictionaryValue* UITest::GetLocalState() { |