Index: tools/ipc_fuzzer/fuzzer/fuzzer.cc |
diff --git a/tools/ipc_fuzzer/fuzzer/fuzzer.cc b/tools/ipc_fuzzer/fuzzer/fuzzer.cc |
index 159ee81f3d7e0f6e042614abc0ae20f552ecf1e0..cc2065d4c4b1f5e68500afceec469486c02ab678 100644 |
--- a/tools/ipc_fuzzer/fuzzer/fuzzer.cc |
+++ b/tools/ipc_fuzzer/fuzzer/fuzzer.cc |
@@ -590,25 +590,29 @@ struct FuzzTraits<base::DictionaryValue> { |
case base::Value::Type::BOOLEAN: { |
bool tmp; |
fuzzer->FuzzBool(&tmp); |
- p->SetWithoutPathExpansion(property, new base::Value(tmp)); |
+ p->SetWithoutPathExpansion(property, |
+ base::MakeUnique<base::Value>(tmp)); |
break; |
} |
case base::Value::Type::INTEGER: { |
int tmp; |
fuzzer->FuzzInt(&tmp); |
- p->SetWithoutPathExpansion(property, new base::Value(tmp)); |
+ p->SetWithoutPathExpansion(property, |
+ base::MakeUnique<base::Value>(tmp)); |
break; |
} |
case base::Value::Type::DOUBLE: { |
double tmp; |
fuzzer->FuzzDouble(&tmp); |
- p->SetWithoutPathExpansion(property, new base::Value(tmp)); |
+ p->SetWithoutPathExpansion(property, |
+ base::MakeUnique<base::Value>(tmp)); |
break; |
} |
case base::Value::Type::STRING: { |
std::string tmp; |
fuzzer->FuzzString(&tmp); |
- p->SetWithoutPathExpansion(property, new base::Value(tmp)); |
+ p->SetWithoutPathExpansion( |
+ property, base::MakeUnique<base::Value>(std::move(tmp))); |
break; |
} |
case base::Value::Type::BINARY: { |
@@ -620,15 +624,15 @@ struct FuzzTraits<base::DictionaryValue> { |
break; |
} |
case base::Value::Type::DICTIONARY: { |
- base::DictionaryValue* tmp = new base::DictionaryValue(); |
- FuzzParam(tmp, fuzzer); |
- p->SetWithoutPathExpansion(property, tmp); |
+ auto tmp = base::MakeUnique<base::DictionaryValue>(); |
+ FuzzParam(tmp.get(), fuzzer); |
+ p->SetWithoutPathExpansion(property, std::move(tmp)); |
break; |
} |
case base::Value::Type::LIST: { |
- base::ListValue* tmp = new base::ListValue(); |
- FuzzParam(tmp, fuzzer); |
- p->SetWithoutPathExpansion(property, tmp); |
+ auto tmp = base::MakeUnique<base::ListValue>(); |
+ FuzzParam(tmp.get(), fuzzer); |
+ p->SetWithoutPathExpansion(property, std::move(tmp)); |
break; |
} |
case base::Value::Type::NONE: |