diff options
Diffstat (limited to 'chrome/installer/util')
-rw-r--r-- | chrome/installer/util/master_preferences.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc index 34d10a9..21c74dd 100644 --- a/chrome/installer/util/master_preferences.cc +++ b/chrome/installer/util/master_preferences.cc @@ -12,14 +12,13 @@ namespace { DictionaryValue* ReadJSONPrefs(const std::string& data) { JSONStringValueSerializer json(data); - Value* root; - if (!json.Deserialize(&root, NULL)) + scoped_ptr<Value> root(json.Deserialize(NULL)); + if (!root.get()) return NULL; - if (!root->IsType(Value::TYPE_DICTIONARY)) { - delete root; + if (!root->IsType(Value::TYPE_DICTIONARY)) return NULL; - } - return static_cast<DictionaryValue*>(root); + + return static_cast<DictionaryValue*>(root.release()); } bool GetBooleanPref(const DictionaryValue* prefs, const std::wstring& name) { |