| Index: chromeos/network/onc/onc_translator_shill_to_onc.cc
|
| diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc
|
| index ad20482ace48a8a0b1383e5f8d016ff83e5c6415..f91950f534e12ab10524246e4ade547b386b820f 100644
|
| --- a/chromeos/network/onc/onc_translator_shill_to_onc.cc
|
| +++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc
|
| @@ -31,18 +31,16 @@ namespace {
|
| // returns NULL.
|
| scoped_ptr<base::Value> ConvertStringToValue(const std::string& str,
|
| base::Value::Type type) {
|
| - base::Value* value;
|
| + scoped_ptr<base::Value> value;
|
| if (type == base::Value::TYPE_STRING) {
|
| - value = new base::StringValue(str);
|
| + value.reset(new base::StringValue(str));
|
| } else {
|
| - value = base::JSONReader::DeprecatedRead(str);
|
| + value = base::JSONReader::Read(str);
|
| }
|
| + if (value && value->GetType() != type)
|
| + return nullptr;
|
|
|
| - if (value == NULL || value->GetType() != type) {
|
| - delete value;
|
| - value = NULL;
|
| - }
|
| - return make_scoped_ptr(value);
|
| + return value;
|
| }
|
|
|
| // This class implements the translation of properties from the given
|
|
|